Smarts: How to verify the elasticsearch service is running and serving requests
search cancel

Smarts: How to verify the elasticsearch service is running and serving requests

book

Article ID: 338355

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

The elasticsearch service, a component of the Notifications cache, is only accessible from the local machine.

Environment

VMware Smart Assurance - Watch4Net/M&R
VMware Smart Assurance - SMARTS

Resolution

Verify this service is running and serving requests.

Procedure:

  1. Verify elasticsearch is running by typing:

$ smarts/bin/sm_service show.

The expected result is:

RUNNING smarts-elasticsearch

  1. Verify elasticsearch is serving requests from a browser on the same machine in Windows or using a tool like curl on Linux.

Windows browser example:

http://localhost:9200/_status

A page specific to the browser will appear.

Linux examples:

curl -XGET http://localhost:9200/_status

curl http://localhost:9200/smarts/alert/_count

A JSON page appears indicating success and shows Smarts as one of the indices:

For example:

"_shards":{"total":10,"successful":5,"failed":0}

...

"indices":{"smarts":...

  1. If the Smarts index does not exist, the setup script has failed. Check the setup_elasticsearch.log file.

Note: After elasticsearch is started, it may take a few minutes before the setup script begins running.

 

Additional Information

In some instances, elasticsearch appears to be running, but not resolving to localhost, causing configuration checks to not be satisfied.
When running the following:


curl -XGET http://127.0.0.1:9200


confirmation is needed that the localhost is resolving to the server, but elasticsearch was not:


<HTML>
<HEAD><TITLE>Redirection</TITLE></HEAD>
<BODY><H1>Redirect</H1></BODY>
[root@SERVER-FQDN bin]#

Then run the following:


service elasticsearch status
=====================================================
Redirecting to /bin/systemctl status  elasticsearch.service
Unit elasticsearch.service could not be found.
======================================================

If the above message is received, reboot the server.