赞
踩
# Use a descriptive name for your cluster:
#
cluster.name: my-application
# Use a descriptive name for the node:
#
node.name: node-1
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
# Path to log files:
#
#path.logs: /path/to/logs
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300
discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 2
// 生成CA证书,执行命令后,系统还会提示你输入密码,可以直接留空
elasticsearch-certutil ca
//生成证书和私钥,系统还会提示你输入密码,你可以输入证书和密钥的密码,也可以留空
elasticsearch-certutil cert --ca elastic-stack-ca.p12
在所有node节点下,在 config目录中创建 certs 文件夹
将elastic-certificates.p12 文件拷贝到certs 目录下(注:是所有的node节点对应的/config/certs)
# 设置密码,对外访问安全认证
xpack.security.enabled: true
xpack.license.self_generated.type: basic
#开启集群内部通信安全认证
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12
# es启动命令(进入bin目录下)
# 前台启动
./elasticsearch
#后台启动
./elasticsearch -d
elasticsearch-setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,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]: Reenter password for [elastic]: Enter password for [apm_system]: Reenter password for [apm_system]: Enter password for [kibana]: Reenter password for [kibana]: 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] Changed password for user [logstash_system] Changed password for user [beats_system] Changed password for user [remote_monitoring_user] Changed password for user [elastic]
# 添加es对应的kibana用户名和密码
elasticsearch.username: "kibana"
elasticsearch.password: "密码"
# Specifies locale to be used for all localizable strings, dates and number formats.
# Supported languages are the following: English - en , by default , Chinese - zh-CN .
i18n.locale: "zh-CN"
#前台运行
./kibana
#后台运行
nohup ../bin/kibana &
最后,可以通过kibana 看到如下界面
安全认证
集群设置
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。