moving the data folder for ES

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

moving the data folder for ES

Post by newmember »

I followed the instructions for moving the /data folder for ES from this document.
https://assets.nagios.com/downloads/nag ... Server.pdf

When I restart the service ES recreates the shard in the original installation directory /usr/local/elasticsearch/data


Thoughts, suggestions?

Thanks
Chris
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: moving the data folder for ES

Post by scottwilkerson »

Did you edit /etc/sysconfig/elasticsearch as outlined on page 2 of that document?

to something like this

Code: Select all

DATA_DIR="/new/path/data"
and then restart ES
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

Re: moving the data folder for ES

Post by newmember »

correct

I had set it to

DATA_DIR=/elasticsearch/data

/elasticsearch/data is on its own 1000G partition

I didnt change any of the the file folder variables.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: moving the data folder for ES

Post by scottwilkerson »

Can you show the results of the following commands

Code: Select all

ps -ef|grep elasticsearch
cat /etc/sysconfig/elasticsearch
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

Re: moving the data folder for ES

Post by newmember »

I would like too but,

I had to rebuild everything last night just so I could get the system setup today.

I would have to retrace my steps.
However if I did what I did before I think it will break again.

If the doc I refenced is correct I will do it again in my new deployment.

Your thoughts?

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: moving the data folder for ES

Post by scottwilkerson »

I have done this procedure before without issue.

Unfortunately in order to see what is going wrong, I would need to see what ES is setting as the -Des.default.path.data which is derived from /etc/sysconfig/elasticsearch and would display in the ps -ef|grep elasticsearch command
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

Re: moving the data folder for ES

Post by newmember »

Just updating apache with the certs etc.

Ill do change next

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: moving the data folder for ES

Post by scottwilkerson »

newmember wrote:Just updating apache with the certs etc.

Ill do change next

Thanks
Sounds good
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
newmember
Posts: 43
Joined: Sat Sep 03, 2016 2:54 pm

Re: moving the data folder for ES

Post by newmember »

Okay

I made an error in my etc so a started an entire new vm.

First thing I did was mount my 1TB drive
Then I installed LS
Then I went to move ES data.

I have attached the CLI steps.


Here is login error I get from the login page:
Login
The username specified does not exist.

In the logs i attached:
You will also notice the the shard has also been recreated in the original spot, I assume my user account is missing from the new shard in the original folder.




One additional note:
Ubuntu 18.04 puts the service in this file, not whats listed in the doc
/etc/init.d/elasticsearch

https://assets.nagios.com/downloads/nag ... Server.pdf
Changing Path
Now you need to change the configuration to point Nagios Log Server to the new data path. Open the file
/etc/sysconfig/elasticsearch in vi by executing the following command:
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: moving the data folder for ES

Post by scottwilkerson »

Sorry I didn't realuse you were on Ubuntu, and I now see the document needs to be updated.

The file the DATA_DIR needs to be edited in is /etc/default/elasticsearch instead of /etc/sysconfig/elasticsearch.

You edited them in the init script but that file has this disclaimer just above where you edited them

Code: Select all

# The following variables can be overwritten in $DEFAULT
$DEFAULT on Unbuntu is /etc/default/elasticsearch

I will have out team get the document updated for Ubuntu.

Sorry for the confusion
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked