I have created a manifest to install and configure elasticsearch via the puppetmodule that is referenced in the official documentation
Everything is installed fine, but the service isn't started even though it should be.
According to the documentation I need to have the status set to enabled to start the service at boot, and ensure it is always running:
node qkvd-elm01 {
include defaults
include ::java
class { 'elasticsearch':
version => '6.2.4',
status => 'enabled',
datadir_instance_directories => false,
config => {
'cluster.name' => 'devops',
}
}
elasticsearch::instance { 'qkvd-elm01':
config => {
'network.host' => '_site_',
'node.name' => 'qkvd-elm01',
'node.master' => true,
'node.data' => false,
'node.ingest' => false,
'node.ml' => false,
'xpack.ml.enabled' => false,
'discovery.zen.minimum_master_nodes' => 2,
'discovery.zen.ping.unicast.hosts' => [
"qkvd-elm01",
"qkvd-elm02",
"qkvd-elm03"
],
}
}
}
After finding that the service isn't started (even though puppet reports that it is), I ran puppet again in debug mode.
Debug: Executing: '/usr/bin/systemctl is-active elasticsearch-qkvd-elm01.service'
Debug: Executing: '/usr/bin/systemctl is-enabled elasticsearch-qkvd-elm01.service'
Debug: Executing: '/usr/bin/systemctl unmask elasticsearch-qkvd-elm01.service'
Debug: Executing: '/usr/bin/systemctl start elasticsearch-qkvd-elm01.service'
Debug: Executing: '/usr/bin/systemctl is-enabled elasticsearch-qkvd-elm01.service'
Notice: /Stage[main]/Main/Node[qkvd-elm01]/Elasticsearch::Instance[qkvd-elm01]/Elasticsearch::Service[qkvd-elm01]/Elasticsearch::Service::Systemd[qkvd-elm01]/Service[elasticsearch-instance-qkvd-elm01]/ensure: ensure changed 'stopped' to 'running'
Debug: /Stage[main]/Main/Node[qkvd-elm01]/Elasticsearch::Instance[qkvd-elm01]/Elasticsearch::Service[qkvd-elm01]/Elasticsearch::Service::Systemd[qkvd-elm01]/Service[elasticsearch-instance-qkvd-elm01]: The container Elasticsearch::Service::Systemd[qkvd-elm01] will propagate my refresh event
Info: /Stage[main]/Main/Node[qkvd-elm01]/Elasticsearch::Instance[qkvd-elm01]/Elasticsearch::Service[qkvd-elm01]/Elasticsearch::Service::Systemd[qkvd-elm01]/Service[elasticsearch-instance-qkvd-elm01]: Unscheduling refresh on Service[elasticsearch-instance-qkvd-elm01]
Debug: Elasticsearch::Service::Systemd[qkvd-elm01]: The container Elasticsearch::Service[qkvd-elm01] will propagate my refresh event
From what I can tell, it should be running, but it is not
[root@qkvd-elm01 ~]# systemctl status elasticsearch-qkvd-elm01.service
● elasticsearch-qkvd-elm01.service - Elasticsearch instance qkvd-elm01
Loaded: loaded (/usr/lib/systemd/system/elasticsearch-qkvd-elm01.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-03-27 12:19:56 IST; 22s ago
Docs: http://www.elastic.co
Process: 19263 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch-qkvd-elm01.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 19263 (code=exited, status=1/FAILURE)
I executed the same command that is sent to STDOUT when running puppet in debug /usr/bin/systemctl start elasticsearch-qkvd-elm01.service
Then checked the status again and found that the service is started.
[root@qkvd-elm01 ~]# systemctl status elasticsearch-qkvd-elm01.service
● elasticsearch-qkvd-elm01.service - Elasticsearch instance qkvd-elm01
Loaded: loaded (/usr/lib/systemd/system/elasticsearch-qkvd-elm01.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-03-27 12:20:38 IST; 1s ago
Docs: http://www.elastic.co
Main PID: 19334 (java)
CGroup: /system.slice/elasticsearch-qkvd-elm01.service
└─19334 /bin/java -Dfile.encoding=UTF-8 -Dio.netty.noKeySetOptimization=true -Dio.netty.noUnsafe=true -Dio.netty.recycler.maxCapacityPerThread=0 -Djava.awt.headless=true -Djna.nosys=true -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError -XX:+...
Mar 27 12:20:38 qkvd-elm01.kayhut.local systemd[1]: Started Elasticsearch instance qkvd-elm01.
Mar 27 12:20:38 qkvd-elm01.kayhut.local systemd[1]: Starting Elasticsearch instance qkvd-elm01...
What am I doing wrong?