一、elasticsearch.yml中設(shè)置
1、進入es的config目錄中打開elasticsearch.yml
2、增加以下兩項:
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
二、重啟es后使用elasticsearch-setup-passwords進行密碼設(shè)置
1、在完成修改elasticsearch.yml后,重啟es;
2、進入es的bin目錄,敲入命令:
./elasticsearch-setup-passwords interactive #linux執(zhí)行這個
elasticsearch-setup-passwords interactive #windows執(zhí)行這個
3、之后分別給elastic, kibana, logstash_system,beats_system等用戶設(shè)置密碼,具體如下例:
[root@hecs-81986 bin]# ./elasticsearch-setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y
Enter password for [elastic]:
passwords must be at least [6] characters long
Try again.
Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana_system]:
Reenter password for [kibana_system]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]
執(zhí)行完畢之后,訪問es節(jié)點就需要用戶名密碼了,如下:文章來源:http://www.zghlxwxcb.cn/news/detail-716636.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-716636.html
到了這里,關(guān)于[Elasticsearch] 給ES設(shè)置必須以用戶名密碼訪問的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!