Page 2 of 5

Re: Backup Repository

Posted: Mon Feb 02, 2015 10:17 am
by scottwilkerson
Sorry, the command we meant to have you run was

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
However, it appears to be executing already, are any backups now showing up?

Re: Backup Repository

Posted: Mon Feb 02, 2015 2:03 pm
by stecino
scottwilkerson wrote:Sorry, the command we meant to have you run was

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
However, it appears to be executing already, are any backups now showing up?
No backups are being created. Based on the apache conf for nagioslogserver

this is the root directory

/var/www/html/nagioslogserver/www/

I would expect to see commands/do_maintenance/_update under the root directory which I don't. Isn't this part of install?

Re: Backup Repository

Posted: Mon Feb 02, 2015 5:33 pm
by scottwilkerson
This is not as you would expect, when you connect from the CLI to localhost:9200 iit is connecting directly to elasticsearch, NOT the web root.

Can you run the following in one terminal

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
By doing this we should see the maintenance jobs go by in the console looking for errors.

Re: Backup Repository

Posted: Mon Feb 02, 2015 6:56 pm
by stecino
scottwilkerson wrote:This is not as you would expect, when you connect from the CLI to localhost:9200 iit is connecting directly to elasticsearch, NOT the web root.

Can you run the following in one terminal

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
By doing this we should see the maintenance jobs go by in the console looking for errors.

[root@nlsserver ~]# curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }'
{"error":"RemoteTransportException[[78a3bc74-18f9-46c6-a763-267d4860c047][inet[/10.68.1.246:9300]][update]]; nested: DocumentMissingException[[nagioslogserver][0] [commands][do_maintenance]: document missing]; ","status":404}[root@nlsserver ~]#


[root@nlsserver nagioslogserver]# tail -f /usr/local/nagioslogserver/var/jobs.log
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Processed 0 node jobs.
Processed 3 global jobs.
tail: /usr/local/nagioslogserver/var/jobs.log: file truncated
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS

Re: Backup Repository

Posted: Tue Feb 03, 2015 10:49 am
by scottwilkerson
Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command

Re: Backup Repository

Posted: Tue Feb 03, 2015 2:44 pm
by stecino
scottwilkerson wrote:Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command
Seems to be working!!

drwxr-xr-x 3 nobody users 4096 Feb 3 11:39 indices
-rw-r--r-- 1 nobody users 61 Feb 3 11:39 metadata-logstash-2015.01.06
-rw-r--r-- 1 nobody users 187 Feb 3 11:39 snapshot-logstash-2015.01.06
[root@nlsserver nls_backup]#

So do I always run this command? What is that ID, does it always stay the same?

Re: Backup Repository

Posted: Tue Feb 03, 2015 5:21 pm
by stecino
stecino wrote:
scottwilkerson wrote:Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command
Seems to be working!!

drwxr-xr-x 3 nobody users 4096 Feb 3 11:39 indices
-rw-r--r-- 1 nobody users 61 Feb 3 11:39 metadata-logstash-2015.01.06
-rw-r--r-- 1 nobody users 187 Feb 3 11:39 snapshot-logstash-2015.01.06
[root@nlsserver nls_backup]#

So this backup generated metadata, snapshot info, and indices. So if I run backup again tomorrow, will it only backup the delta, or will it backup last 30 day retention data again?
So do I always run this command? What is that ID, does it always stay the same?

Re: Backup Repository

Posted: Wed Feb 04, 2015 2:11 pm
by scottwilkerson
It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.

Re: Backup Repository

Posted: Wed Feb 04, 2015 2:29 pm
by stecino
scottwilkerson wrote:It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.
Thanks alot for the help, this can be closed.

Re: Backup Repository

Posted: Wed Feb 04, 2015 2:47 pm
by stecino
stecino wrote:
scottwilkerson wrote:It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.
Thanks alot for the help, this can be closed.
Actually before you close it :)

It seems that the backup kicked off at exact time to the backup i did yesterday. Is there a way to adjust the time so it runs at night?