How to keep EnterpriseSearch running all the time

I have an SSL connection to the server where EnterpriseSearch is set up, and start EnterpriseSearch from the command line with the following command.

$ ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] bin/enterprise-search

After confirming that you can access EnterpriseSearch from your browser, close the terminal with the SSL connection.
How do I keep it running at all times?

Hi its-ogawa -

There are a number of ways to achieve this, and various options also depending on the operating system you are running.

The most simple way to run Enterprise Search as a service is to run it as a service using one of the prebuilt packages. There are packages available for Debian (Ubuntu) and RPM-based systems (RedHat, CentOs, etc.) available on the Enterprise Search download page. Once installed, you can manage the system to allow Enterprise Search to start up as any other system service.

If you do not want to (or cannot) use the prebuilt packages, then with your current installation, you can always run enterprise search as above in a screen session or using nohup to run the process in the background.

Hope this helps.

  • Mark

Thank you for the advice.
I see. I did get enterprisesearch as tar.gz.

Since I got elasticsearch with rpm, I would like to match enterprisesearch with it if possible.

However, I couldn't find the module for enterprisesearch when I got it with rpm.
Where is it extracted to?
If it is elasticsearch, it will be extracted under /etc/elasticsearch.

The installation procedure I followed is as follows

wget https://artifacts.elastic.co/downloads/enterprise-search/enterprise-search-7.12.1.rpm
rpm -ivh enterprise-search-7.12.1

I'm sorry. It was just an oversight on my part.

It will probably be extracted to /usr/share/enterprise-search/ by default.

Am I correct in assuming that I can run it permanently by properly configuring config/enterprise-search.yml and doing systemctl start enterprise-search?

I will describe the execution procedure in my CentOS environment.

$ wget https://artifacts.elastic.co/downloads/enterprise-search/enterprise-search-7.12.1.rpm
$ rpm -ivh enterprise-search-7.12.1
$ cd /usr/share/enterprise-search/
$ vi config/enterprise-search.yml
... snip ...
$ systemctl start enterprise-search
$ ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] bin/enterprise-search&

This is correct if using the .rpm or .deb packages. Also, if you want to enable the Enterprise Search service to be started after a boot as well, you should run systemctl enable enterprise-search.

I'm sorry to ask this question again after closing it once.

I thought I was starting with the following command, but found that I could not connect.

# systemctl enable enterprise-search

The service appears to be up and running.

# systemctl status enterprise-search
● enterprise-search.service - Elastic Enterprise Search
   Loaded: loaded (/usr/lib/systemd/system/enterprise-search.service; enabled; vendor preset: disabled)
   Active: active (running) since 木 2021-06-10 19:42:20 JST; 9s ago
     Docs: https://www.elastic.co/guide/en/enterprise-search/current/index.html
 Main PID: 22237 (java)
   CGroup: /system.slice/enterprise-search.service
           mq22237 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.awt.hea...

 6月 10 19:42:20 ITS-ELS-01 systemd[1]: Stopped Elastic Enterprise Search.
 6月 10 19:42:20 ITS-ELS-01 systemd[1]: Started Elastic Enterprise Search.
 6月 10 19:42:20 ITS-ELS-01 enterprise-search[22237]: Found java executable in PATH
 6月 10 19:42:20 ITS-ELS-01 enterprise-search[22237]: Java version detected: 1.8.0_282 (major version: 8)
 6月 10 19:42:20 ITS-ELS-01 enterprise-search[22237]: Enterprise Search is starting...
 6月 10 19:42:20 ITS-ELS-01 enterprise-search[22237]: Logs can be found in the location configured via the 'log_directory' setting (typically /var/log/enterprise-search)

However, since there are no services occupying the port, it is still assumed that it is not working.

# lsof -i:3002
#

Is there a way to deal with this?

The following command with the nohup command mentioned above did not start successfully.

$ ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] nohup bin/enterprise-search

To be precise, nohup is working. The jobs command confirms that it is running in the background.
However, EnterpriseSearch is not running.

A guess would be

ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] nohup bin/enterprise-search &

Unfortunately, that will soon stop.

# ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] nohup /usr/share/enterprise-search/bin/enterprise-search &
[1] 16209
# nohup: ignore the input and append the output to `nohup.out'.


[1]+  STOP                  ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] nohup /usr/share/enterprise-search/bin/enterprise-search
# jobs
[1]+  STOP                  ENT_SEARCH_DEFAULT_PASSWORD=[REDACTED] nohup /usr/share/enterprise-search/bin/enterprise-search
#

I have installed the rpm as well as other Elastic products, but why can't EnterpriseSearch start properly with systemctl start enterprise-search?
To be precise, the status is healthy, but I cannot access it from a browser.
I have confirmed that I can start EnterpriseSearch with bin/enterprise-search.