For how long should your certificate be valid? [5y] # 设置证书的有效时间
Generate a certificate per node? [y/N]y # 为每个节点生成证书
node #1 name: es.xiaowangc.local # 节点1的名称
Enter all the hostnames that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
es.xiaowangc.local
You entered the following hostnames.
- es.xiaowangc.local
Is this correct [Y/n]y # 确认信息无误
Enter all the IP addresses that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
192.168.10.224 # 节点的IP
You entered the following IP addresses.
- 192.168.10.224
Is this correct [Y/n]y # 确认信息无误
The generated certificate will have the following additional configuration values. These values have been selected based on a combination of the information you have provided above and secure defaults. You should not need to change these values unless you have specific requirements.
Do you wish to change any of these options? [y/N]n # 是否更改 Generate additional certificates? [Y/n]n # 是否生成其他证书
If you wish to use a blank password, simply press <enter> at the prompt below. Provide a password for the "http.p12" file: [<ENTER> for none] # 给证书加密,直接回车不加密
What filename should be used for the output zip file? [/usr/local/elasticsearch-8.5.3/elasticsearch-ssl-http.zip] # 输出的文件名
[root@xiaowangc elasticsearch-8.5.3]# su elastic [elastic@xiaowangc elasticsearch-8.5.3]$ nohup ./bin/elasticsearch &
更改ES密码
1 2 3 4 5 6 7 8
[elastic@xiaowangc elasticsearch-8.5.3]$ ./bin/elasticsearch-reset-password -u elastic This tool will reset the password of the [elastic] user to an autogenerated value. The password will be printed in the console. Please confirm that you would like to continue [y/N]y
Password for the [elastic] user successfully reset. New value: AaGWf1Krql6*rpnYBgjE
[root@es01 elasticsearch-8.5.3]# cd .. [root@es01 local]# chown -R elastic.elastic elasticsearch-8.5.3/ [root@es01 local]# su elastic [root@es01 local]# su elastic [elastic@es01 local]$ cd elasticsearch-8.5.3/ [elastic@es01 elasticsearch-8.5.3]$ nohup ./bin/elasticsearch &
更改密码
1 2 3 4 5 6 7 8 9 10 11 12 13
# 自动设置所有密码,只能使用一次 [elastic@es01 elasticsearch-8.5.3]$ ./bin/elasticsearch-reset-password auto # 手动设置跟单机一样 [elastic@es01 elasticsearch-8.5.3]$ ./bin/elasticsearch-reset-password -u elastic This tool will reset the password of the [elastic] user to an autogenerated value. The password will be printed in the console. Please confirm that you would like to continue [y/N]y
Password for the [elastic] user successfully reset. New value: cmo6aWzTVF+YegghL+h=
[root@es01 elasticsearch-8.5.3]# ./bin/elasticsearch-certutil http Generate a CSR? [y/N]n Use an existing CA? [y/N]y CA Path: ca.crt CA Key: ca.key For how long should your certificate be valid? [5y] Generate a certificate per node? [y/N]y # 是否为每个节点生成证书 node #1 name: es01.xiaowangc.local
Enter all the hostnames that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
node01.xiaowangc.local
You entered the following hostnames.
- node01.xiaowangc.local
Is this correct [Y/n]y
Enter all the IP addresses that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
Do you wish to change any of these options? [y/N]n Generate additional certificates? [Y/n]y # 是否继续生成证书
node #2 name: es02.xiaowangc.local
Enter all the hostnames that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
es02.xiaowangc.local
You entered the following hostnames.
- es02.xiaowangc.local
Is this correct [Y/n]y
Enter all the IP addresses that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
192.168.10.232
You entered the following IP addresses.
- 192.168.10.232
Is this correct [Y/n]y Do you wish to change any of these options? [y/N]n Generate additional certificates? [Y/n]y # 是否继续生成证书
node #3 name: es03.xiaowangc.local
Enter all the hostnames that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
es03.xiaowangc.local
You entered the following hostnames.
- es03.xiaowangc.local
Is this correct [Y/n]y
Enter all the IP addresses that you need, one per line. When you are done, press <ENTER> once more to move on to the next step.
192.168.10.233
You entered the following IP addresses.
- 192.168.10.233
Is this correct [Y/n]y Do you wish to change any of these options? [y/N]n Generate additional certificates? [Y/n]n
If you wish to use a blank password, simply press <enter> at the prompt below. Provide a password for the "http.p12" file: [<ENTER> for none] ## Where should we save the generated files?
What filename should be used for the output zip file? [/usr/local/elasticsearch-8.5.3/elasticsearch-ssl-http.zip]