uvacw / inca

24 stars 6 forks source link

Deletebackup #323

Closed damian0604 closed 6 years ago

damian0604 commented 6 years ago

new function to delete backups:

FeLoe commented 6 years ago

I tried testing it, but I couldn't even create a repository or a backup (hence also not delete a backup :) ) as the instructions on how to add a "path.repo" argument to the elasticsearch.yml file (in create_repository) did not work:

 echo "path.repo: ["/home/felicia/es_backups"]" >> /etc/elasticsearch/elasticsearch.yml
 grep path.repo /etc/elasticsearch/elasticsearch.yml

I get

path.repo: [/home/felicia/es_backups]

So this seems to work fine...but when I then restart elasticsearch it fails to start. This is the output

Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since wo 2018-03-07 15:20:37 CET; 5s ago
Docs: http://www.elastic.co
Process: 24501 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.d
Process: 24496 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 24501 (code=exited, status=1/FAILURE)

mrt 07 15:19:47 felicia-VirtualBox systemd[1]: Starting Elasticsearch...
mrt 07 15:19:48 felicia-VirtualBox systemd[1]: Started Elasticsearch.
mrt 07 15:20:37 felicia-VirtualBox systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
mrt 07 15:20:37 felicia-VirtualBox systemd[1]: elasticsearch.service: Unit entered failed state.
mrt 07 15:20:37 felicia-VirtualBox systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

After this I actually had to reinstall elasticsearch to get it working again. So either there is some mistake in the code I ran (which was what was suggested for create_repository) or my installation of elasticsearch runs into troubles after I set the path.repo file. Extensive googling couldn't give me a solution...

damian0604 commented 6 years ago

Thanks for trying, @FeLoe !

Does /home/felicia/es_backups exist and is it writable for elasticsearch?

Try sudo chown elasticsearch.elasticsearch /home/felicia/es_backups and maybe also chmod 775 /home/felicia/es_backups

If that's it, we should add it to the instructions as well...

FeLoe commented 6 years ago

Perfect, that did the trick! I added the explanation to the docstring and also fixed some issues with restore_backup, now this also works.

damian0604 commented 6 years ago

Thanks a lot!