Unable to do anything properly with ES

Dear All,
I followed exactly the guide here to install ES :slight_smile:

But when I run : sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
I keep getting this error :
ERROR: Failed to determine the health of the cluster. , with exit code 69

I didn't do anything after installation, according to documentation, there's no details.
Please help, I am really stuck, and unable to go further with ES, documentation doesn't show any further information
I am on :
Linux Mint 20.1 Cinnamon
openjdk 11.0.21 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Thank you

Hi @hich_testone Welcome to the community!

For us to help you should always post the error messages.

Perhaps take a look at

Hello and thank you for your reply, here's the command and error I keep getting :

sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
ERROR: Failed to determine the health of the cluster. , with exit code 69

I am doing exactly as explained in documentation here :

But I am stuck, may be something is missing in documentation because I really followed the instructions but I got the error above.

Thank you

Hi @hich_testone

Did you look at the link I provided for the same error?

Hi @stephenb
Yes, I am not running same command, I am running the command I found in documentation :

sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node

Dear @stephenb
This is my day 2 with ES :slight_smile:
I did EXACTLY the steps explained in "Install Elasticsearch with Debian Package" guide, but I am stuck with

sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node

I have removed and re-install ES with no success, do I have to try a different way to install and use ES ?

Regards

Have you tried to curl from the server elasticsearch is running on?

Please run that and show the command you're running and the entire output.

curl -k -v -u elastic https://127.0.0.1:9200

With the respect to the enrollment command you're running...

Please share the entire error message not just the last line...

In short you will probably need to add the --url settings on the command try ... See the docs

sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node --url https://127.0.0.1:9200

curl -k -v -u elastic https://127.0.0.1:9200
Enter host password for user 'elastic':
* Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
*   Trying 127.0.0.1:9200...
* TCP_NODELAY set
* connect to 127.0.0.1 port 9200 failed: Connection refused
* Failed to connect to 127.0.0.1 port 9200: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused
sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node --url https://127.0.0.1:9200

ERROR: Failed to determine the health of the cluster. , with exit code 69

I got only the error with elasticsearch-create-enrollment-token command

Thank you

Did you actually start elasticsearch?
Do you have a proxy on that host?

Try the same command using localhost

No, I didn't start ES, I am on my computer
I got same errors
This is my ES status (please note that I removed ES and reinstall it at 3pm):

service elasticsearch status
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: https://www.elastic.co

janv. 02 14:49:57 hish-Lenovo-ideapad-310-15IKB systemd[1]: Stopping Elasticsearch...
janv. 02 14:50:00 hish-Lenovo-ideapad-310-15IKB systemd[1]: elasticsearch.service: Succeeded.
janv. 02 14:50:00 hish-Lenovo-ideapad-310-15IKB systemd[1]: Stopped Elasticsearch.
janv. 02 14:50:13 hish-Lenovo-ideapad-310-15IKB systemd[1]: Starting Elasticsearch...
janv. 02 14:50:15 hish-Lenovo-ideapad-310-15IKB systemd-entrypoint[14454]: janv. 02, 2024 2:50:15 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
janv. 02 14:50:15 hish-Lenovo-ideapad-310-15IKB systemd-entrypoint[14454]: WARNING: COMPAT locale provider will be removed in a future release
janv. 02 14:50:32 hish-Lenovo-ideapad-310-15IKB systemd[1]: Started Elasticsearch.
janv. 02 15:18:56 hish-Lenovo-ideapad-310-15IKB systemd[1]: Stopping Elasticsearch...
janv. 02 15:18:58 hish-Lenovo-ideapad-310-15IKB systemd[1]: elasticsearch.service: Succeeded.
janv. 02 15:18:58 hish-Lenovo-ideapad-310-15IKB systemd[1]: Stopped Elasticsearch.

So, I do not think it is running...

sudo systemctl start

You will need to look at the logs... I suspect it may be crashing Out Of Memory...

SOOOO lets back up ... are you just trying to run elastic on your Laptop?

Have you considered using docker?

Often I do not recall recommend using .deb package for just testing on a laptop...

What are you trying to accomplish overall... This is Testing / Fun? / Learning? / long term deployment?

You mean I have to start ES ?

I am a web developer, I have to learn ES
Ain't no log file in /var/log/elasticsearch
So which method should I try to use ES ?
Today I need it to install magento2
Thank you

Yes. Per the docs you have followed...
Actually, I stand corrected, elasticsearch should have started the first time, BUT it has failed. We would have to take a look I suspect it is OOM.

This is because elastic will try to clai. half the memory on the hoat as it's expecting to be the only system on the host would installed as a package like you did. That can be adjusted if needed. Mike

Well this is server / data store stuff so a lot of this will be new...

Can you use docker? Do you know how to use Docker Desktop? That is probably what I would recommend....

For a laptop Docker / Docker Compose is probably easiest.

When you say Learn Elastic... the Basics? or details like Security etc..etc...

Also curious why you wanted to install another node elasticsearch rule work well on a laptop with just 1 node

I/we can not help you with magneto... This community is only for elasticsearch.

So let us know what you want to do and perhaps we can help

Dear @stephenb ,
I don't ask about magento, but ES, I heard a lot about and really would use in my projects, I want run ES properly on my laptop
ok, I found a link where someone talked about increasing memory in jvn.options (xms & xmx 1g) and ES starts finally

systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-01-02 20:59:25 +01; 3min 21s ago
       Docs: https://www.elastic.co
   Main PID: 38708 (java)
      Tasks: 82 (limit: 9301)
     Memory: 1.5G
     CGroup: /system.slice/elasticsearch.service
             β”œβ”€38708 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=/usr/share/elasticsearch/bin/elasticsearch -Dc>
             β”œβ”€38782 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:>
             └─38806 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

janv. 02 20:58:15 hish-Lenovo-ideapad-310-15IKB systemd[1]: Starting Elasticsearch...
janv. 02 20:58:27 hish-Lenovo-ideapad-310-15IKB systemd-entrypoint[38708]: janv. 02, 2024 8:58:27 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
janv. 02 20:58:27 hish-Lenovo-ideapad-310-15IKB systemd-entrypoint[38708]: WARNING: COMPAT locale provider will be removed in a future release
janv. 02 20:59:25 hish-Lenovo-ideapad-310-15IKB systemd[1]: Started Elasticsearch.

Why isn't this mentioned in the official install documentation ? :sob: :sob: :sob: :sob: :sob: :sob: :sob:
Now I finally create the token :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear:

sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
eyJ2ZXIiOiI4LjExLjMiLCJhZHIiOlsiMTkyLjE2OC44LjEwMDo5MjAwIl0sImZnciI6IjZjYmU5MmNiNDgxZjU2NWNmNzY0NmUzODUxNDRlNGIwYzMwZTc3ZjBiY2YxYWQ1ZjVlNTUwOGNiZWUxNzMxMTEiLCJrZXkiOiJ2M1BIeTR3QmxNLUNEZzNuSDlDRDpyTFRWNHNZb1FPMkt4RHk4SkhpdERRIn0=

But :rage: :rage: :rage: :

sudo /usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token 
eyJ2ZXIiOiI4LjExLjMiLCJhZHIiOlsiMTkyLjE2OC44LjEwMDo5MjAwIl0sImZnciI6IjZjYmU5MmNiNDgxZjU2NWNmNzY0NmUzODUxNDRlNGIwYzMwZTc3ZjBiY2YxYWQ1ZjVlNTUwOGNiZWUxNzMxMTEiLCJrZXkiOiJ2M1BIeTR3QmxNLUNEZzNuSDlDRDpyTFRWNHNZb1FPMkt4RHk4SkhpdERRIn0=

ERROR: Skipping security auto configuration because it appears that the node is not starting
up for the first time. The node might already be part of a cluster and this auto setup utility is
designed to configure Security for new clusters only., with exit code 80

Any idea please ?

BTW :

curl -k -v -u elastic https://127.0.0.1:9200
Enter host password for user 'elastic':
* Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
*   Trying 127.0.0.1:9200...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=hish-Lenovo-ideapad-310-15IKB
*  start date: Jan  2 14:28:38 2024 GMT
*  expire date: Jan  1 14:28:38 2026 GMT
*  issuer: CN=Elasticsearch security auto-configuration HTTP CA
*  SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
* Server auth using Basic with user 'elastic'
> GET / HTTP/1.1
> Host: 127.0.0.1:9200
> Authorization: Basic ZWxhc3RpYzpEOEJVVURKXyphclR1UG5OY2gwdw==
> User-Agent: curl/7.68.0
> Accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< X-elastic-product: Elasticsearch
< content-type: application/json
< content-length: 553
< 
{
  "name" : "hish-Lenovo-ideapad-310-15IKB",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Ih9nArXWRCW7PTpVF2cgqA",
  "version" : {
    "number" : "8.11.3",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "64cf052f3b56b1fd4449f5454cb88aca7e739d9a",
    "build_date" : "2023-12-08T11:33:53.634979452Z",
    "build_snapshot" : false,
    "lucene_version" : "9.8.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}
* Connection #0 to host 127.0.0.1 left intact

Thank you very much

1 Like

Excellent!

You do not need enrollment or reconfiguration with only one node. It's already up and running.

Those steps are only when you're using multi node cluster, which you are not. You do not need that.

Unless you're planning to run three separate nodes on your single laptop, which you cannot do the way you've done it, you don't need the enrollment to work.

There is much in the documentation about the JVM settings, but again when you install elasticsearch it's expecting to be on its own server and then claim the memory. This is clearly called out in the documentation.

So you should be good to go!

If you have room I would set the JVM to 2gb

Also, your single node cluster will show Health Yellow that is because there is only 1 node so there are no "replica" shards" .... just keep in mind if you delete the indices they will be gone... if you laptop disks/dies crashes etc.. all the normal caveats of running tools on a laptop ... that said I have been running elasticsearch for a long time on my laptop with good results

As you ask more questions, please make clear subject/ titles you'll get more help! If it's just a vague title, many of us won't respond. Also provide as much information and context as possible up front that will help with quicker answers. Of course, no answers are guaranteed since this is a community forum

Thank you very much @stephenb for your assistance, I will try to be more accurate next time :slight_smile:
Do you know why this command :

sudo /usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <generated_token_I_got_with_create-enrollment-token>

Gives me this error (no other information, just this output below) :

ERROR: Skipping security auto configuration because it appears that the node is not starting up for the first time. The node might already be part of a cluster and this auto setup utility is designed to configure Security for new clusters only., with exit code 80

Regards

I do not know why / where you are running this.. you do not need to reconfigure your original node ... That is NOT the intention...just stop where you are... You're single node elasticsearch cluster is operating as designed at this point.

The curl command above validated that

Unless you are trying to add another node from a different host... Is that what you are trying to do?

Otherwise you were just trying to tell the the current cluster to enroll with itself which is not a valid command

In the next round not now :rofl: :rofl: :rofl:
I need some rest now to purge my brain :slightly_smiling_face:
Thank you for you assitance @stephenb really appreciate it

Ok make sense :+1: :+1: :+1:

Kind regards

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.