使用
uname -a
查看 Linux 系统内核与版本,选择对应的安装包,
下文以Linux x86_64 / Kibana 8.7
为例,演示通过RPM
和压缩包
两种方式的安装步骤。
1 下载与安装
Download Kibana
1.1 RPM
Install Kibana with RPM
# 创建并切换目录
mkdir /data/elastic
cd /data/elastic
# 下载
wget https://artifacts.elastic.co/downloads/kibana/kibana-8.7.0-x86_64.rpm
# 安装
rpm -ivh kibana-8.7.0-x86_64.rpm
# 查看配置文件位置
rpm -qc kibana
1.2 压缩包
Install Kibana from archive on Linux or MacOS
# 创建用户 kibana,其中 -d 和 -m 选项用来为登录名 kibana产生一个主目录 /home/kibana
useradd -d /home/kibana-m kibana
# 指定用户 elastic 的口令
passwd kibana
# 创建安装目录
mkdir -p /app/kibana
# 更改目录权限
chown -R kibana:kibana /app/kibana
# 切换用户
sudo su - kibana
# 切换目录
cd /app/kibana
# 下载安装包
wget https://artifacts.elastic.co/downloads/kibana/kibana-8.7.0-linux-x86_64.tar.gz
# 解压安装包
tar -zxvf kibana-8.7.0-linux-x86_64.tar.gz
# 切换解压后的目录
cd /app/kibana/kibana-8.7.0
2 生成证书
Set up basic security for the Elastic Stackedit
Set up basic security for the Elastic Stack plus secured HTTPS trafficedit
执行命令
openssl x509 -fingerprint -sha256 -in /etc/elasticsearch/certs/http_ca.crt
将返回的密钥内容保存到 pem 文件vim /etc/kibana/elasticsearch-ca.pem
-----BEGIN CERTIFICATE-----
MIIFWjCCA0KgAwIBAgIVAJk71vEBOaTf+sl61h4SPkcsu2GOMA0GCSqGSIb3DQEB
CwUAMDwxOjA4BgNVBAMTMUVsYXN0aWNzZWFyY2ggc2VjdXJpdHkgYXV0by1jb25m
aWd1cmF0aW9uIEhUVFAgQ0EwHhcNMjMwNDE2MDc1NTMwWhcNMjYwNDE1MDc1NTMw
WjA8MTowOAYDVQQDEzFFbGFzdGljc2VhcmNoIHNlY3VyaXR5IGF1dG8tY29uZmln
dXJhdGlvbiBIVFRQIENBMIICIjANBgkqhkiG9w0BAQEFAAO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B16Tz8kE2slpEJTeRr83IzSUVcZ+Fi3OrRdyNpC6/6j/
4M279EHqFizf3xkSNEOVOu5QSeyRFSamgRo7S1CKtD1zwyBdtjzbCXLiWI5g6Pxd
/d2nB2hetNncvKzdkALR+g/Edcq92Q5s9ByyPNUB59zBzz/YElLzkZVOp7jM2Kfh
rhwHTDBzqvjPLWKI6PWiEPtIGriHY7IVVtzxmBndO30sBNtb3BIXevO8nTAyrBTg
kgHMZtj080K2ZkkwK5wtap+IIv7aT1M7/ocA7QW4xLmYAo9lVbr9c2Ax9vE/fK1Z
eGJ+QycCu5bMdFOmVG1vYEsUmsjqiWelX0RW3sLyveozEn6f3tkLNCoUXMQrPLF9
pwooGp46KiceptQmDD51r9St5Q3nYpz4P9mBx32VNVz1w9gBtSMllHLsiWZ9ofzE
jJcSGtO/S5Ntdx2uLlz2cCH+JnRpo5exOLrHV/2W
-----END CERTIFICATE-----
3 初始化账号
elasticsearch-reset-password
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u kibana_system
# 保存以上命令返回的新密码
New value: X33TCwX6EQB7d9lT33sX
4 配置
Configure Kibana
- RPM 安装的配置文件路径
vim /etc/kibana/kibana.yml
- 压缩包 安装的配置文件路径
vim /../kibana-8.7.0/config/kibana.yml
# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "172.16.32.2"
# Specifies the public URL at which Kibana is available for end users. If
# `server.basePath` is configured this URL should end with the same basePath.
server.publicBaseUrl: "http://172.16.32.2"
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["https://172.16.32.2:9200"]
# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
elasticsearch.username: "kibana_system"
elasticsearch.password: "X33TCwX6EQB7d9lT33sX"
# Enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
elasticsearch.ssl.certificateAuthorities: [ "/etc/kibana/elasticsearch-ca.pem" ]
# To disregard the validity of SSL certificates, change this setting's value to 'none'.
elasticsearch.ssl.verificationMode: none
# Enables you to specify a file where Kibana stores log output.
logging:
appenders:
file:
type: file
fileName: /var/log/kibana/kibana.log
layout:
type: json
root:
appenders:
- default
- file
# Specifies the path where Kibana creates the process ID file.
pid.file: /run/kibana/kibana.pid
# Specifies locale to be used for all localizable strings, dates and number formats.
# Supported languages are the following: English (default) "en", Chinese "zh-CN", Japanese "ja-JP", French "fr-FR".
i18n.locale: "zh-CN"
# 即将弃用,建议标记false
xpack.reporting.roles.enabled: false
5 启动与停止
5.1 RPM
# 配置系统启动时自动启动
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service
# 启动
service kibana start
# 停止
service kibana stop
# 检查服务状态
service kibana status
# 查看日志
journalctl -u kibana.service
5.2 压缩包
命令行方式
文章来源:https://www.toymoban.com/news/detail-586469.html
# 启动
/app/kibana/kibana-8.7.0/bin/kibana
# 停止
Ctrl-C
守护进程方式
文章来源地址https://www.toymoban.com/news/detail-586469.html
# 启动
/app/kibana/kibana-8.7.0/bin/kibana -d -p pid
# 停止
pkill -F pid
到了这里,关于Kibana [8.7] 安装与配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!