and path.log not used

I am running Elasticsearch on VMs in Google Cloud (using the standard latest 7.x debian package installation) and am trying out different configurations. I recently tried to run a cluster with VMs with local SSD (local disks connected to VM via nvme, like instance store in AWS). I formatted and mounted the drive properly (to the path /mnt/data) and updated the elasticsearch.yml configuration to set /mnt/data/lib and path.logs: /mnt/data/log) but when I start elasticsearch it uses the defaults /var/lib/elasticsearch and /var/log/elasticsearch instead.

I'm wondering if this may be happening because the machine I installed elasticsearch on was different (it was a packer build machine). Does the elasticsearch.yml configuration need to be updated before running systemctl enable elasticsearch.service?

I install elasticsearch and run the commands systemctl daemon-reload and systemctl enable elasticsearch.service (as well as some of the other system configuration) in the packer build machine and export the image and then when I create the cluster VMs I use that image and when booting I complete the installation by updating elasticsearch.yml and running systemctl start elasticsearch.service. Is that approach not valid?

I also had tried restoring a snapshot taken from a previous cluster that used the default paths (/var/lib/elasticsearch and /var/log/elasticsearch). Would that be a possible cause of the issue?

I found the cause of this issue. I didn't realize that systemctl enable elasticsearch.service sets the service to start immediately at the next boot and so it started before I updated the elasticsearch.yml configuration during the boot up of the cluster VMs. When I removed that from the packer build script and did it in the actual cluster VM startup that resolved the issue

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.