Elasticsearch(全文検索エンジン)のインストール後の初めての起動に失敗する時があります。
systemctl status elasticsearch で確認すると下記のような状態。
# systemctl status elasticsearch ● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 土 2017-12-09 00:41:42 JST; 3min 52s ago Docs: http://www.elastic.co Process: 10829 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE) Process: 10827 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS) Main PID: 10829 (code=exited, status=1/FAILURE) 12月 09 00:41:42 testsv.sagadensan.net systemd[1]: Starting Elasticsearch... 12月 09 00:41:42 testsv.sagadensan.net systemd[1]: Started Elasticsearch. 12月 09 00:41:42 testsv.sagadensan.net elasticsearch[10829]: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin) 12月 09 00:41:42 testsv.sagadensan.net systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE 12月 09 00:41:42 testsv.sagadensan.net systemd[1]: Unit elasticsearch.service entered failed state. 12月 09 00:41:42 testsv.sagadensan.net systemd[1]: elasticsearch.service failed. Hint: Some lines were ellipsized, use -l to show in full.
この原因は、メッセージにも書かれているように Java が入っていないからです。
Elasticsearch では Java が必要なので別途インストールする必要があります。
# yum install java
これでOK。起動するはずです。