I still couldn't get this to work, I have the same issue as described above. Trying to start enterprise-search as a service but it doesn't seem to be doing anything.
systemctl cat enterprise-search.service
prints the following:
[Unit]
Description=Elastic Enterprise Search
Documentation=https://www.elastic.co/guide/en/enterprise-search/current/index.html
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/usr/share/enterprise-search
User=enterprise-search
Group=enterprise-search
ExecStart=/usr/share/enterprise-search/bin/enterprise-search
Restart=on-failure
RestartSec=1s
PrivateTmp=true
Environment=ENTERPRISE_SEARCH_SYSTEM_TMP_DIR=true
# Suppress logging to stdout by default, since this duplicates what's written to
# files in the configured logs directory (see 'log_directory' config setting),
# and also because by default systemd sends this output to /var/log/messages,
# which is not wanted in most scenarios
Environment=ENT_SEARCH_QUIET_STDOUT=true
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Specifies the maximum number of processes
LimitNPROC=4096
# Specifies the maximum size of virtual memory
LimitAS=infinity
# Specifies the maximum file size
LimitFSIZE=infinity
# Wait for the process to stop before killing the whole group
TimeoutStopSec=60
# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM
# Send the SIGTERM signal only to the JVM rather than its control group, but kill the whole group if needed
KillMode=mixed
# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
For good measure as per the solution above, I also created this at /etc/systemd/system/enterprise-search.service
When I check the service status, I see:
● enterprise-search.service - Elastic Enterprise Search
Loaded: loaded (/lib/systemd/system/enterprise-search.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-07-10 15:26:17 UTC; 3s ago
Docs: https://www.elastic.co/guide/en/enterprise-search/current/index.html
Main PID: 9144 (java)
Tasks: 19 (limit: 9536)
Memory: 209.0M
CGroup: /system.slice/enterprise-search.service
└─9144 java -cp /usr/share/enterprise-search/lib/war/lib/jruby-stdlib-9.2.13.0.jar:/usr/share/enterprise-search/lib/war/lib/jruby-core-9.2.13.0-complete.jar -Djruby.cli.warning.level=NIL -Djava.a>
Jul 10 15:26:17 ip-172-31-55-51 systemd[1]: Started Elastic Enterprise Search.
Jul 10 15:26:17 ip-172-31-55-51 enterprise-search[9144]: Found java executable in PATH
Jul 10 15:26:18 ip-172-31-55-51 enterprise-search[9144]: Java version detected: 11.0.11 (major version: 11)
Jul 10 15:26:18 ip-172-31-55-51 enterprise-search[9144]: Enterprise Search is starting...
Jul 10 15:26:18 ip-172-31-55-51 enterprise-search[9144]: Logs can be found in the location configured via the 'log_directory' setting (typically /var/log/enterprise-search)
But when I check the app-server.log
at the location above, there are no new entries. If I start enterprise-search from the command line as per the documentation, all is fine:
$ sudo /usr/share/enterprise-search/bin/enterprise-search
Found java executable in PATH
Java version detected: 11.0.11 (major version: 11)
Enterprise Search is starting...
*** [DEPRECATION WARNING] The setting '#/ent_search/auth/source' is deprecated and will be removed in version '8.0.0'. Please use the new auth config format ent_search.auth.<auth_name>.source.
[2021-07-10T15:29:21.246+00:00][9828][2002][app-server][INFO]: Enterprise Search version=7.13.2, JRuby version=9.2.13.0, Ruby version=2.5.7, Rails version=5.0.7.2
[2021-07-10T15:29:21.276+00:00][9828][2002][app-server][INFO]: Performing pre-flight checks for Elasticsearch running on http://127.0.0.1:9201...
[2021-07-10T15:29:23.118+00:00][9828][2002][app-server][INFO]: [pre-flight] Elasticsearch cluster is ready
[2021-07-10T15:29:23.124+00:00][9828][2002][app-server][INFO]: [pre-flight] Successfully connected to Elasticsearch
[2021-07-10T15:29:23.218+00:00][9828][2002][app-server][INFO]: [pre-flight] Successfully loaded Elasticsearch plugin information for all nodes
[2021-07-10T15:29:23.401+00:00][9828][2002][app-server][INFO]: [pre-flight] Elasticsearch running with an active basic license
[2021-07-10T15:29:23.759+00:00][9828][2002][app-server][INFO]: [pre-flight] Elasticsearch API key service is enabled
[2021-07-10T15:29:23.760+00:00][9828][2002][app-server][INFO]: [pre-flight] ILM is enabled in Elasticsearch
[2021-07-10T15:29:23.764+00:00][9828][2002][app-server][INFO]: Elasticsearch looks healthy and configured correctly to run Enterprise Search
...
I tried starting it with nohup
, that didn't work either. So this means that I can have enterprise search running, as long as my session is open.
There has to be a way to start this as other companies are providing it as a service. Would be great to include the procedure in the documentation also but for now, could I get some help with getting this to work, please??