Home  >  Article  >  Java  >  How to solve the problem of configuring the account and password of the ElasticSearch cluster environment in Java

How to solve the problem of configuring the account and password of the ElasticSearch cluster environment in Java

WBOY
WBOYforward
2023-04-20 12:43:062611browse

1. Modify the elasticsearch.yml of the main site and add the following line:

xpack.security.enabled: true

2. Generate a security key

Cut to the ES installation directory and execute bin/elasticsearch-certutil ca -out config/elastic-certificates.p12 -pass ""

will generate elastic in the /home/elasticsearch-7.9.3/config directory -certificates.p12

3. Continue to modify the ES yml file

Add the following four lines:

xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates .p12

4. Update the configuration of the cluster node

Copy elastic-certificates.p12 to the config of other nodes, and modify the yml of other nodes at the same time.

5. Restart ES

6. Execute ./elasticsearch-setup-passwords interactive to set the password.

7. Problem handling during the process:

7.1 After executing the third step, execute ./elasticsearch-setup-passwords interactive directly. Always prompts "ERROR: Failed to set password for user [apm_system]"

How to solve the problem of configuring the account and password of the ElasticSearch cluster environment in Java

##8. Effect:

How to solve the problem of configuring the account and password of the ElasticSearch cluster environment in Java

The above is the detailed content of How to solve the problem of configuring the account and password of the ElasticSearch cluster environment in Java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete