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

使用apt安装

1
2
3
4
5
6
7
8
9
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

sudo apt-get install apt-transport-https


echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list

sudo apt-get update && sudo apt-get install kibana

下面记录一下使用 apt 按照的过程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ sudo apt-get install kibana
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
kibana
0 upgraded, 1 newly installed, 0 to remove and 282 not upgraded.
Need to get 253 MB of archives.
After this operation, 700 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 kibana amd64 7.10.2 [253 MB]
Fetched 253 MB in 1min 4s (3,954 kB/s)
Selecting previously unselected package kibana.
(Reading database ... 84905 files and directories currently installed.)
Preparing to unpack .../kibana_7.10.2_amd64.deb ...
Unpacking kibana (7.10.2) ...
Processing triggers for ureadahead (0.100.0-20) ...
ureadahead will be reprofiled on next reboot
Setting up kibana (7.10.2) ...
Processing triggers for systemd (237-3ubuntu10.12) ...
Processing triggers for ureadahead (0.100.0-20) ...


安装完成会建个linux的系统账号kibana:x:112:116::/home/kibana:/bin/false

手动安装

1
2
3
4
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.10.2-amd64.deb


sudo dpkg -i kibana-7.10.2-amd64.deb

安装完成后 ES 并没有启动的。下面就要配置一下开机自启动。

配置ES开机自启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1️⃣ 如果是比较旧的ubuntu版本,使用的还是 sysv init 管理开机自启动进程的话 执行下面的命令设置开机自启动。
sudo update-rc.d kibana defaults 95 10


使用下面命令 启动和停止服务
sudo -i service kibana start
sudo -i service kibana stop

2️⃣ 如果是比较新的ubuntu版本,使用的 systemd 管理的使用下面的命令。
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service

使用下面命令 启动和停止服务
sudo systemctl start kibana.service
sudo systemctl stop kibana.service

其他配置

设置可以远程访问。

1
2
3
4
5
6
7
# 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: "0.0.0.0"

设置语言为中文,这样看起来就简单多了。

1
2
3
4
# 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"