#2923 (Improve lino backup for hosting services)
by khchine5 · in Developers · assigned to khchine5
Résumé
Improve lino backup for hosting services
Concepts sous-jacents
Commentaires
- 6 ans, 4 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : We decided to get the mail system to run before continuing on this ticket. Because it is difficult to fix the problem when we don't even get the error message.
- 6 ans, 4 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Did you fix it? And if yes, what was the problem?
- 6 ans, 4 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The last snapshot of avanti was created 7 juin. Going to fix that.
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : It seems that the collectsnapshots cronjob worked fine this morning.
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Not all the folders under mirror home are owned by the user mirror . This was the error with the command find at the end of the file /mnt/disk/mirror/collect_snapshots.sh Fixing this.
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : We still have the same error again.
- 6 ans, 5 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Our current guess is that the rsync fails because the snapshot.zip on the target is being built at 6:25 every morning, exactly the same time as we try to make a copy. We moved collect_snapshots out of /etc/cron.daily and added it manually to crontab to run it a bit later (6:35) than the make_snapsho...
- 6 ans, 5 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : I manually tried "sudo -u mirror /mnt/disk/mirror/collect_snapshots.sh" several times. The first times it failed, but at some moment it started to work... and I don't see why... at the moment the problem is not reproducible.
- 6 ans, 5 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : It is indeed strange. Even the following works: sudo -u mirror unzip -l /home/admin/mypy/prod_sites/rumma/snapshot.zip IOW the problem isn't reproducible locally. Can we reproduce it using curl for example?
- 6 ans, 5 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Which file permission did you change to let mirror user read it? The mirror user is part of the www-data group. Maybe it is because not all parts of the path are group readable and (group owned by www-data): $ go rumma ; ls -ald . drwxrwsr-x 10 luc www-data 4096 May 18 06:25 . # ok luc@ovh1:/home/a...
- 6 ans, 5 mois ago by Luc Saffre in reply to khchine5 about #2923 (Improve lino backup for hosting services) : Keep in mind that the file re-created when make_snapshot.sh runs.
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) (1 reply) : I set the file's permission to let mirror use read it but when the cronjob run again restore the permission to old one.
- 6 ans, 5 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Hamza, are you still stuck on this? What the hell takes so much time there? It looks like a simple permissions problem?
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The cronjob fails to run on SR server even that the command is Ok when I ran manually.
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Make the make_snapshot cronjob to run the command as hamza instead of root
- 6 ans, 5 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The snapshot.zip on rumma was owned by root . Need to check this.
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Today we are getting "rsync: link_stat "/home/admin/mypy/prod_sites/rumma/snapshot.zip" failed: No such file or directory (2)" It seems that the snapshot.zip get not created for rumma. I will check this.
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The issue was stupid , the authorized_keys file in mylino server was wrong . I changed it with the correct one.
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The collect_snapshots.sh works fine now , let's see tomorrow morning if we get cron mail error. I correctly configured my SR mail into my Gmail client.
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : debugging from SR when trying to connect to mylino.net I got debug1: Authentications that can continue: publickey,password debug1: Trying private key: /mnt/disk/mirror/.ssh/id_dsa debug3: no such identity: /mnt/disk/mirror/.ssh/id_dsa: No such file or directory debug1: Trying private key: /mnt/disk/m...
- 6 ans, 6 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Hamza, please have a look at this. We are still getting on error message in cron job: /etc/cron.daily/collect_snapshots: mirror@167.114.252.133: Permission denied (publickey,password). rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data...
- 6 ans, 6 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Hamza and I did several more changes in the scripts. It is important to call collect_snapshots.sh using "sudo -u mirror" and not using "sudo su mirror".
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : What is strange that for chatlet it works just when the logged user is mirror but not hamza. Worked fine: sudo su mirror ; ssh mirror@cpaschatelet.no-ip.org Doesn't work : ssh -i .ssh/id_rsa mirror@cpaschatelet.no-ip.org Even that the last command works for mylino.net
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : We should do : chmod 400 ~/.ssh/id_rsa
- 6 ans, 6 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Permissions 0644 for '/mnt/disk/snapshots_collection/.ssh/id_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/mnt/disk/snapshots_collection/.ssh/id_rsa": bad permissions
- 6 ans, 7 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Confirmed. Trying to ssh from SR says "Permission denied (publickey,password)". But I don't believe that their network admin has done it. Maybe dyndns blocks ping, Can you connect from your machine as hamza?
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : I can't even ping the chalet server from the SR server. I thing that has to do with a security restriction set by the admin the chalet server.
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : I am getting issue to make ssh connection to chatlet server using the mirror user with his ssh key
- 6 ans, 7 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Thats because of autodoc. You must run inv clean -b once.
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : I get also lino.modlib.system.choicelists.rst:document isn't included in any toctree
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : A command with sudo will give the ownership to the root user not the mirror , I think.
- 6 ans, 7 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : OK, I leave you working on it. Wouldn't it be easier to use "sudo mirror ssh-keygen..." instead of fixing permissions afterwards?
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Yes I know I was trying to fix this.
- 6 ans, 7 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : I am building the book with your new page. I edited docs/admin/index.rst to include the new page because "inv bd" said "docs/admin/backup.rst:document isn't included in any toctree".
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : Adding check_collect_snapshots.sh to book/admin
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : A monit check of more than one day old of all backups files is added. We will get notifications email from monit if we have always the lasted snapshots file.
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : For some reasons the collect_snapshots.sh daily cron job doesn't work. For the moment I have just soshilfe which create a daily snapshot which I can't found in SR.
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : I have committed a new documentation about hosting backup and monitoring to book/admin/backup.rst
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The collect_snapshots script is added as a daily cron job.
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : The new script collect_snapshots.sh copy all snapshots.zip files from mylino.net for the rumma and soshilfe ans eiche. I am writing documentation for this
- 6 ans, 7 mois ago by khchine5 about #2923 (Improve lino backup for hosting services) : I have created the ssh key with the mirror mail. @luc , I cant find the collect_snapshot.sh script , could you please share it with me ?
- 6 ans, 7 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : Hamza, please try to open an account on amazon and try to setup a backup server there. For the start phase it should be free if I remember well.
- 6 ans, 8 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : They don't need to be able to restore themselves a backup. We can use a separate backup server where only we have access, and which stores the latest snapshots of all customers.
- 6 ans, 8 mois ago by Luc Saffre about #2923 (Improve lino backup for hosting services) : I reactivate this ticket because we will start avanti hosting in April. Let's talk about this tomorrow.