How to move data?

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

How to move data?

Post by 2evanowen »

Hey guys,

Our /usr directory is becoming very large. We are looking to move only the data from elasticsearch over and keeping all of the configuration files in place.
What is the best way to do this? Which folders will I have to move over? Which configuration files will I need to modify? Which services do I need to stop before doing this?


I was thinking of copying all the data from /usr/local/nagioslogserver/elasticsearch/data to /data1/data, then just making a soft link from /usr/local/nagioslogserver/elasticsearch/data to /data1/data. Would that work? Is that all I have to do?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How to move data?

Post by jolson »

was thinking of copying all the data from /usr/local/nagioslogserver/elasticsearch/data to /data1/data, then just making a soft link from /usr/local/nagioslogserver/elasticsearch/data to /data1/data. Would that work? Is that all I have to do?
I tested the above in a lab, and it worked like a charm. Full procedure:

Code: Select all

service elasticsearch stop
cd /usr/local/nagioslogserver/elasticsearch
mkdir /data1 ; chown nagios.nagios /data1/
mv data/ /data1/
ln -s /data/data/ data
service elasticsearch start
If elasticsearch is running and notices that it has lost data, it will try rebuilding your database with _nothing_ inside of it. You should be able to perform this procedure in a rolling fashion - one instance at a time until complete.

Let us know if you have any problems, thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

Re: How to move data?

Post by 2evanowen »

It looks like it worked, until I log in. Then clicking around I have an error and it looks like most of my logs aren't there:
Screen Shot 2016-01-20 at 2.13.56 PM.png
You do not have the required permissions to view the files attached to this post.
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

Re: How to move data?

Post by 2evanowen »

I have only updated one of the nodes so far, should I do the other now?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How to move data?

Post by jolson »

Give the other one a try as well - and be sure that the 'nagios' user is allowed to write to your new directory properly.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

Re: How to move data?

Post by 2evanowen »

Okay I did the other one as well. Still Doesn't seem to be helping...
Both servers have the nagios:nagios for the owner and group....

Last one:

Code: Select all

[owen@barium data1]$ ls -al
total 4
drwxr-xr-x   3 nagios nagios   17 Jan 20 13:55 .
dr-xr-xr-x. 19 root   root   4096 Jan 20 09:55 ..
drwxr-xr-x.  4 nagios nagios   92 Nov 23 15:04 data
New server:

Code: Select all

[owen@calcium data1]$ ls -al
total 4
drwxr-xr-x.  3 nagios nagios   17 Jan 20 15:39 .
dr-xr-xr-x. 19 root   root   4096 Jan 20 09:40 ..
drwxr-xr-x.  4 nagios nagios   92 Nov 23 15:06 data

It looks like calcium is getting logs from barium, but that's the only server:
Screen Shot 2016-01-20 at 4.35.40 PM.png
You do not have the required permissions to view the files attached to this post.
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

Re: How to move data?

Post by 2evanowen »

Oh yes,
I am getting this FacetPhaseExecutionException message every once in while on the dashboard:
Screen Shot 2016-01-20 at 4.52.51 PM.png
You do not have the required permissions to view the files attached to this post.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How to move data?

Post by jolson »

Is your cluster status green?

Code: Select all

curl 'localhost:9200/_cluster/health?level=indices&pretty'
If not, it's possible that you need to give the cluster some time to distribute data appropriately.

Alternatively, you could try changing the DATA_DIR directive in /etc/sysconfig/elasticsearch:

DATA_DIR="/data1/data"

Give elasticsearch a restart after that and let me know if it helps - this directive will not be overwritten on upgrade.

Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
2evanowen
Posts: 35
Joined: Fri Jan 16, 2015 1:24 pm

Re: How to move data?

Post by 2evanowen »

I got it working!
My global settings were messed up for some reason and didn't have my cluster hostname in there.

Both ways work for me now, the link and the DATA_DIR.

Thanks for your help!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: How to move data?

Post by bwallace »

Thanks for that update and glad to hear it is working -- we'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked