Page 1 of 2
Log server repository permission
Posted: Wed Mar 04, 2015 9:35 pm
by OptimusB
I am setting up a shared repository for our Log Server cluster. What are the file permissions required for backup and maintenance for the repository? Or better yet, what is the user account that it is using to write the backups files on the shared volume?
Thanks in advance.
Re: Log server repository permission
Posted: Thu Mar 05, 2015 2:19 pm
by jolson
The user account that writes the backups is 'nagios' (GID/UID 500).
Regarding permissions - I would say give full permissions, though I don't know that execute will be necessary.
EDIT: After testing, the nagios user will need rwx permissions on the directory in question, otherwise no backups are created.
Re: Log server repository permission
Posted: Thu Mar 05, 2015 7:52 pm
by OptimusB
Thanks. I am setting up a CIFS share and for permissions I would like to give the "nagios" user rw permissions. I cannot mount the share unless I have the password for the 'nagios" user? Please advise.
Thanks!
Re: Log server repository permission
Posted: Fri Mar 06, 2015 10:11 am
by jolson
The following is an example CIFS share that I have tested as working, located in /etc/fstab:
Code: Select all
//192.168.1.1/NLSbackup /bkk cifs rw,relatime,sec=ntlm,unc=\\192.168.1.1\NLSbackup,username=jesse,password=testpassword,uid=500,noforceuid,gid=500,noforcegid,addr=192.168.1.1,file_mode=0770,dir_mode=0770,serverino,rsize=16384,wsize=65536 0 0
Does that help give you an answer? The username and password I use are for the CIFS share in question.
Re: Log server repository permission
Posted: Fri Mar 06, 2015 1:20 pm
by OptimusB
Thanks for the example. I followed the syntax and created mount for the repository. Thanks!
I will now see if the backup job will run.
Re: Log server repository permission
Posted: Fri Mar 06, 2015 1:53 pm
by jolson
No problem, that sounds great. Keep in mind you may have to remount the directory for permissions to take effect:
Code: Select all
umount /backupdir
mount /backupdir
I look forward to your results. Thanks!
Re: Log server repository permission
Posted: Mon Mar 09, 2015 11:47 am
by OptimusB
Thanks again for the permissions. Repository and backups are now working.
I noticed that the indices closed manually by me aren't backed up in the repository. Is this by-design of the backup mechanism?
Re: Log server repository permission
Posted: Mon Mar 09, 2015 2:39 pm
by jolson
No problem. The backup process uses Curator - please refer to the following documentation regarding usage:
https://github.com/elasticsearch/curato ... umentation
If your closed indices are not being backed up by default, maybe you could get them to show with:
Code: Select all
curator show --show-indices
-or-
curator show --show-indices <INDEX NAME>
After getting them to show, try adding them to a snapshot manually:
Code: Select all
curator snapshot --repository REPOSITORY_NAME indices <>
Let me know if this helps. The default behavior of Curator is to ignore closed indices, and I could not figure out how to change that behavior.
Best,
Jesse
Re: Log server repository permission
Posted: Mon Mar 09, 2015 6:45 pm
by OptimusB
I am not able to get the following commands to work. Looking at Elasticsearch's page, it seems the syntax is correct.....
Code: Select all
curator show --show-indices <INDEX NAME>
Code: Select all
curator snapshot --repository REPOSITORY_NAME indices <>
Code: Select all
[root@localhost]# curator show --show-indices logstash-2015.12.23
usage: curator [-h] [-v] [--host HOST] [--url_prefix URL_PREFIX] [--port PORT]
[--ssl] [--auth AUTH] [-t TIMEOUT] [--master-only] [-n] [-D]
[--loglevel LOG_LEVEL] [-l LOG_FILE] [--logformat LOGFORMAT]
{show,allocation,alias,snapshot,close,bloom,optimize,delete}
...
curator: error: unrecognized arguments: logstash-2015.12.23
[root@localhost]# curator show --show-indices | grep logstash-2015.12.23
logstash-2015.12.23
[root@localhost]# curator snapshot --repository "test repo" indices logstash-2015.12.23
usage: curator [-h] [-v] [--host HOST] [--url_prefix URL_PREFIX] [--port PORT]
[--ssl] [--auth AUTH] [-t TIMEOUT] [--master-only] [-n] [-D]
[--loglevel LOG_LEVEL] [-l LOG_FILE] [--logformat LOGFORMAT]
{show,allocation,alias,snapshot,close,bloom,optimize,delete}
...
curator: error: unrecognized arguments: indices logstash-2015.12.23
Re: Log server repository permission
Posted: Tue Mar 10, 2015 9:26 am
by jolson
After further testing, I was not able to get closed indices to appear in the snapshot - my apologies for the misinformation. The procedure I used is as follows:
Code: Select all
[root@localhost /]# curator show --show-indices
logstash-2015.03.07
logstash-2015.03.08
logstash-2015.03.09
logstash-2015.03.10
logstash-2015.10.27
logstash-2015.10.29
logstash-2015.12.03
logstash-2015.12.04
logstash-2015.12.06
logstash-2015.12.07
logstash-2015.12.08
[root@localhost /]# curator show --show-indices --prefix logstash-2015.12.0
logstash-2015.12.03
logstash-2015.12.04
logstash-2015.12.06
logstash-2015.12.07 #this is a closed index
logstash-2015.12.08
[root@localhost /]# curator snapshot --prefix logstash-2015.12.07 --repository backupclosedindices --most-recent 1
2015-03-10 09:20:32,482 INFO Job starting...
2015-03-10 09:20:32,482 INFO Default timeout of 30 seconds is too low for command SNAPSHOT. Overriding to 21,600 seconds (6 hours).
2015-03-10 09:20:32,487 INFO Beginning SNAPSHOT operations...
2015-03-10 09:20:32,495 WARNING Unable to perform snapshot on closed index logstash-2015.12.07
2015-03-10 09:20:32,495 INFO Snapshot 'latest' 1 indices operations completed.
2015-03-10 09:20:32,495 INFO Done in 0:00:00.023885.
Curator cannot backup closed Indices, because Elasticsearch doesn't have that functionality. The Elasticsearch backup page only mentions backing up open Indices.
Is there anything else I can help you with?