Centos 7.4下安装kibana
一. 以yum方式安装kibana
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 [root@LogServer yum.repos.d]# sudo yum install kibana 2 Loaded plugins: fastestmirror, langpacks 3 base | 3.6 kB 00:00:00 4 docker-ce-stable | 3.5 kB 00:00:00 5 elastic-7.x | 1.3 kB 00:00:00 6 extras | 3.4 kB 00:00:00 7 rsyslog_v8 | 2.5 kB 00:00:00 8 updates | 3.4 kB 00:00:00 9 Loading mirror speeds from cached hostfile 10 * base: ap.stykers.moe 11 * extras: centos.ustc.edu.cn 12 * updates: ap.stykers.moe 13 Resolving Dependencies 14 --> Running transaction check 15 ---> Package kibana.x86_64 0:7.4.0-1 will be installed 16 --> Finished Dependency Resolution 17 18 Dependencies Resolved 19 20 ======================================================================================================================================================================== 21 Package Arch Version Repository Size 22 ======================================================================================================================================================================== 23 Installing: 24 kibana x86_64 7.4.0-1 elastic-7.x 248 M 25 26 Transaction Summary 27 ======================================================================================================================================================================== 28 Install 1 Package 29 30 Total download size: 248 M 31 Installed size: 688 M 32 Is this ok [y/d/N]: y 33 Downloading packages: 34 kibana-7.4.0-x86_64.rpm | 248 MB 00:02:40 35 Running transaction check 36 Running transaction test 37 Transaction test succeeded 38 Running transaction 39 Warning: RPMDB altered outside of yum. 40 Installing : kibana-7.4.0-1.x86_64 1/1 41 Verifying : kibana-7.4.0-1.x86_64 1/1 42 43 Installed: 44 kibana.x86_64 0:7.4.0-1 45 46 Complete!
二. 修改/etc/kinaba/kibana.yml配置文件
1 [root@LogServer kibana]# egrep -v "#|^$" /etc/kibana/kibana.yml 2 server.port: 5601 3 server.host: "172.33.7.51" 4 elasticsearch.hosts: ["http://localhost:9200"]
三. 加入自启动
[root@LogServer yum.repos.d]# sudo /bin/systemctl daemon-reload [root@LogServer yum.repos.d]# sudo /bin/systemctl enable kibana.service Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /etc/systemd/system/kibana.service.
四. 启动
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 [root@LogServer yum.repos.d]# sudo systemctl start kibana.service 2 [root@LogServer yum.repos.d]# sudo systemctl status kibana.service 3 ? kibana.service - Kibana 4 Loaded: loaded (/etc/systemd/system/kibana.service; enabled; vendor preset: disabled) 5 Active: active (running) since Sat 2019-10-05 09:25:48 CST; 7s ago 6 Main PID: 100686 (node) 7 CGroup: /system.slice/kibana.service 8 +-100686 /usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml 9 10 Oct 05 09:25:48 LogServer systemd[1]: Started Kibana. 11 Oct 05 09:25:48 LogServer systemd[1]: Starting Kibana... 12 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["info","plugins-system"],"pid":100686,"message":"Settin...or,data]"} 13 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["info","plugins","security"],"pid":100686,"message":"Se...p plugin"} 14 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["warning","plugins","security","config"],"pid":100686,"...bana.yml"} 15 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["warning","plugins","security","config"],"pid":100686,"...mmended."} 16 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["info","plugins","translations"],"pid":100686,"message"...p plugin"} 17 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["info","plugins","data"],"pid":100686,"message":"Setting up plugin"} 18 Oct 05 09:25:50 LogServer kibana[100686]: {"type":"log","@timestamp":"2019-10-05T01:25:50Z","tags":["info","plugins-system"],"pid":100686,"message":"Starti...ns,data]"} 19 Hint: Some lines were ellipsized, use -l to show in full.
五. 检查进程和端口(5601)
1 [root@LogServer zhangxm]# ps -aux | grep kibana 2 kibana 112311 0.5 4.6 1829452 374636 ? Ssl Oct06 5:04 /usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml 3 root 117136 0.0 0.0 112664 980 pts/0 S+ 11:43 0:00 grep --color=auto kibana
1 [root@LogServer zhangxm]# netstat -ntpl 2 Active Internet connections (only servers) 3 Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 4 tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd 5 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1434/sshd 6 tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1659/master 7 tcp 0 0 172.33.7.51:5601 0.0.0.0:* LISTEN 112311/node 8 tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 880/rsyslogd 9 tcp6 0 0 :::111 :::* LISTEN 1/systemd 10 tcp6 0 0 127.0.0.1:9200 :::* LISTEN 109068/java 11 tcp6 0 0 ::1:9200 :::* LISTEN 109068/java 12 tcp6 0 0 127.0.0.1:9300 :::* LISTEN 109068/java 13 tcp6 0 0 ::1:9300 :::* LISTEN 109068/java 14 tcp6 0 0 :::22 :::* LISTEN 1434/sshd 15 tcp6 0 0 ::1:25 :::* LISTEN 1659/master 16 tcp6 0 0 :::514 :::* LISTEN 880/rsyslogd
PS:由于kibana是使用node.js开发的,所以进程名称为node。
六. 用crul测试
没有修改kibana.yml文件之前,测试结果如下:
1 [root@LogServer yum.repos.d]# curl -iv localhost:5601 2 * About to connect() to localhost port 5601 (#0) 3 * Trying ::1... 4 * Connection refused 5 * Trying 127.0.0.1... 6 * Connected to localhost (127.0.0.1) port 5601 (#0) 7 > GET / HTTP/1.1 8 > User-Agent: curl/7.29.0 9 > Host: localhost:5601 10 > Accept: */* 11 > 12 < HTTP/1.1 302 Found 13 HTTP/1.1 302 Found 14 < location: /app/kibana 15 location: /app/kibana 16 < kbn-name: kibana 17 kbn-name: kibana 18 < kbn-xpack-sig: f0c1c5b40ad1dc4981bf5caf8f1cc686 19 kbn-xpack-sig: f0c1c5b40ad1dc4981bf5caf8f1cc686 20 < content-type: text/html; charset=utf-8 21 content-type: text/html; charset=utf-8 22 < cache-control: no-cache 23 cache-control: no-cache 24 < content-length: 0 25 content-length: 0 26 < Date: Sat, 05 Oct 2019 01:26:51 GMT 27 Date: Sat, 05 Oct 2019 01:26:51 GMT 28 < Connection: keep-alive 29 Connection: keep-alive 30 31 < 32 * Connection #0 to host localhost left intact
修改之后的测试结果如下,即不能再用localhost
1 [root@LogServer /]# curl -iv localhost:5601 2 * About to connect() to localhost port 5601 (#0) 3 * Trying ::1... 4 * Connection refused 5 * Trying 127.0.0.1... 6 * Connection refused 7 * Failed connect to localhost:5601; Connection refused 8 * Closing connection 0 9 curl: (7) Failed connect to localhost:5601; Connection refused
只能改为
1 [root@LogServer /]# curl -iv 172.33.7.51:5601 2 * About to connect() to 172.33.7.51 port 5601 (#0) 3 * Trying 172.33.7.51... 4 * Connected to 172.33.7.51 (172.33.7.51) port 5601 (#0) 5 > GET / HTTP/1.1 6 > User-Agent: curl/7.29.0 7 > Host: 172.33.7.51:5601 8 > Accept: */* 9 > 10 < HTTP/1.1 302 Found 11 HTTP/1.1 302 Found 12 < location: /app/kibana 13 location: /app/kibana 14 < kbn-name: kibana 15 kbn-name: kibana 16 < kbn-xpack-sig: f0c1c5b40ad1dc4981bf5caf8f1cc686 17 kbn-xpack-sig: f0c1c5b40ad1dc4981bf5caf8f1cc686 18 < content-type: text/html; charset=utf-8 19 content-type: text/html; charset=utf-8 20 < cache-control: no-cache 21 cache-control: no-cache 22 < content-length: 0 23 content-length: 0 24 < Date: Sun, 06 Oct 2019 13:00:09 GMT 25 Date: Sun, 06 Oct 2019 13:00:09 GMT 26 < Connection: keep-alive 27 Connection: keep-alive 28 29 < 30 * Connection #0 to host 172.33.7.51 left intact
七. 修改firewall
1 [root@LogServer zhangxm]# firewall-cmd --zone=public --add-port=5601/tcp --permanent 2 success 3 [root@LogServer zhangxm]# firewall-cmd --reload 4 success
重启Kibana
1 [root@LogServer zhangxm]# systemctl restart kibana.service 2 [root@LogServer zhangxm]# systemctl status kibana.service 3 ? kibana.service - Kibana 4 Loaded: loaded (/etc/systemd/system/kibana.service; enabled; vendor preset: disabled) 5 Active: active (running) since Thu 2019-10-17 19:35:58 CST; 2s ago 6 Main PID: 65098 (node) 7 CGroup: /system.slice/kibana.service 8 +-65098 /usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml 9 10 Oct 17 19:35:58 LogServer systemd[1]: Started Kibana.
八. 浏览器查看
谷歌或火狐浏览器打开,http://localhost:5601/status,查看服务器状态
Directory layout of RPM
The RPM places config files, logs, and the data directory in the appropriate locations for an RPM-based system:
Type | Description | Default Location | Setting |
---|---|---|---|
home |
Kibana home directory or |
|
|
bin |
Binary scripts including |
|
|
config |
Configuration files including |
|
|
data |
The location of the data files written to disk by Kibana and its plugins |
|
|
logs |
Logs files location |
|
|
optimize |
Transpiled source code. Certain administrative actions (e.g. plugin install) result in the source code being retranspiled on the fly. |
|
|
plugins |
Plugin files location. Each plugin will be contained in a subdirectory. |
|