05ELK基本使用-kibana

阅读量: zyh 2019-12-16 14:00:10
Categories: > Tags:

安装

https://www.elastic.co/guide/en/kibana/current/targz.html

appName=kibana
esVersion=7.15.1
cd /export/src
curl "https://mirrors.huaweicloud.com/${appName}/${esVersion}/${appName}-${esVersion}-linux-x86_64.tar.gz" -o ${appName}.tgz
tar xf ${appName}.tgz
mv ${appName}-${esVersion}-linux-x86_64 ../${appName} && cd ..
useradd -U ${appName}
chown -R ${appName}:${appName} /export/${appName}
cd /export/${appName}

配置

https://www.elastic.co/guide/en/kibana/current/settings.html

cp /export/kibana/config/kibana.yml /export/kibana/config/kibana.yml.default
cat > /export/kibana/config/kibana.yml << EOF
server.name: kibana
server.host: 0.0.0.0
server.port: 5601
elasticsearch.hosts: ["http://hadoop001:9200","http://hadoop002:9200","http://hadoop003:9200"]
xpack.monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: zh-CN
EOF
bin/kibana-encryption-keys generate
# 将输出的 `Settings` 配置追加到 kibana.yml
xpack.encryptedSavedObjects.encryptionKey: 40233b82c57c14127363
xpack.reporting.encryptionKey: f5550ba4b241b820b
xpack.security.encryptionKey: 9732d0b256555b

系统用户(可选)

仅当ES开启安全配置后需要.

追加下列配置到kibana.yml,kibana通过kibana_system用户访问elasticsearch执行后台任务.

elasticsearch.username: "kibana_system"

执行下列命令,将密码加密存放.

./bin/kibana-keystore create
./bin/kibana-keystore add elasticsearch.password
=>输入ES安全配置期间,生成的`kibana_system`内置用户密码

启动

su - kibana
cd /export/kibana
nohup ./bin/kibana &

ℹ️如果启用安全设置和用户配置,则kibana的web访问需要elastic用户权限.

用户权限管理

https://www.elastic.co/guide/en/kibana/7.15/tutorial-secure-access-to-kibana.html