elasticsearch

problem with adding new node to elasticsearch cluster


i want to add new node to elastic cluster by enrollment token but i got the error below

E:\node-1\bin>elasticsearch-create-enrollment-token.bat -s node

18:44:40.729 [main] ERROR org.elasticsearch.xpack.security.enrollment.ExternalEnrollmentTokenGenerator - Error 400when calling GET http://192.168.99.135:9200/_security/api_key. ResponseBody: {error=no handler found for uri [/_security/api_key] and method [POST]} Unable to create enrollment token for scope [node]

ERROR: Unexpected response code [400] from calling POST http://192.168.99.135:9200/_security/api_key

any solution will be highly appreciated


Solution

  • This seems to be a late reply but could be helpful for others. I was having the same issue. when I tried to run multiple instance of elastic search instance by copying already executed folder. For this you need to

    1. create another folder by unzipping of downloaded elastic search.
    2. rename newly created elastic folder name to node_1(or your favorite name)
    3. open './config/elasticsearch.yml' in node_1 folder in your favorite editor.
      1. uncomment node.name: node-1 line and give unique value [alphanumric with hyphen]
      2. save the file.

    Now go to your terminal and try again with same command i.e.

    elasticsearch-create-enrollment-token.bat -s node <enrollment_code>

    It will create new node.

    Note: You need to create enrollment_code before doing above steps.

    Happy Learning!! 🫱🏽‍🫲🏾