Centos7.4安裝elasticsearch+kibana集群

Tags: elasticsearch

主機(jī)環(huán)境

配置:

節(jié)點(diǎn)數(shù) 4
操作系統(tǒng) CentOS Linux release 7.4.1708 (Core)
內(nèi)存 16GB

軟件環(huán)境

軟件 版本 下載地址
jdk jdk-8u172-linux-x64 點(diǎn)擊下載
elasticsearch elasticsearch-6.3.1 點(diǎn)擊下載
kibana kibana-6.3.1-linux-x86_64 點(diǎn)擊下載

主機(jī)規(guī)劃

4個(gè)節(jié)點(diǎn)角色規(guī)劃如下:

主機(jī)名 pycdhnode1 pycdhnode2 pycdhnode3 pycdhnode4
IP 192.168.0.158 192.168.0.159 192.168.0.160 192.168.0.161
master節(jié)點(diǎn) yes yes yes yes
data節(jié)點(diǎn) yes yes yes yes
kibana yes no no no

注: 在實(shí)際生產(chǎn)中闷畸,還是建議master節(jié)點(diǎn)和data節(jié)點(diǎn)分離

主機(jī)安裝前準(zhǔn)備

1. 關(guān)閉所有節(jié)點(diǎn)的 SELinux

sed -i 's/^SELINUX=.*$/SELINUX=disabled/g' /etc/selinux/config 
setenforce 0

2. 關(guān)閉所有節(jié)點(diǎn)防火墻 firewalld or iptables

systemctl disable firewalld; 
systemctl stop firewalld;
systemctl disable iptables; 
systemctl stop iptables;

3. 開(kāi)啟所有節(jié)點(diǎn)時(shí)間同步 ntpdate

echo "*/5 * * * * /usr/sbin/ntpdate [asia.pool.ntp.org](http://asia.pool.ntp.org/) | logger -t NTP" >> /var/spool/cron/root

4. 設(shè)置所有節(jié)點(diǎn)語(yǔ)言編碼以及時(shí)區(qū)

echo 'export TZ=Asia/Shanghai' >> /etc/profile
echo 'export LANG=en_US.UTF-8' >> /etc/profile
. /etc/profile

5. 所有節(jié)點(diǎn)添加elasticsearch用戶(hù)

useradd -m elasticsearch
echo 'elasticsearch' | passwd --stdin elasticsearch

修改家目錄

mv /home/elasticsearch /application
chown -R elasticsearch. /application/elasticsearch

vi /etc/passwd毛肋,修改elasticsearch用戶(hù)家目錄:

elasticsearch:x:1001:1001::/application/[elasticsearch:/bin/bash](http://elasticsearch/bin/bash)

設(shè)置PS1

su - elasticsearch
echo 'export PS1="\u@\h:\$PWD>"' >> ~/.bash_profile
echo "alias mv='mv -i'
alias rm='rm -i'" >> ~/.bash_profile
. ~/.bash_profile

6. 設(shè)置elasticsearch用戶(hù)之間免密登錄
首先在pycdhnode1主機(jī)生成秘鑰

su - elasticsearch
ssh-keygen -t rsa # 一直回車(chē)即可生成elasticsearch用戶(hù)的公鑰和私鑰
cd .ssh
vi id_rsa.pub # 去掉私鑰末尾的主機(jī)名 elasticsearch@pycdhnode1
cat id_rsa.pub > authorized_keys
chmod 600 authorized_keys

壓縮.ssh文件夾

su - elasticsearch
zip -r ssh.zip .ssh

隨后分發(fā)ssh.zip到pycdhnode2-4主機(jī)elasticsearch用戶(hù)家目錄解壓即完成免密登錄

7. 主機(jī)內(nèi)核參數(shù)優(yōu)化以及最大文件打開(kāi)數(shù)原朝、最大進(jìn)程數(shù)等參數(shù)優(yōu)化
不同主機(jī)優(yōu)化參數(shù)有可能不一樣,故這里不作出具體優(yōu)化方法瞻坝,但如果elasticsearch環(huán)境用于正式生產(chǎn)墩虹,必須優(yōu)化航厚,linux默認(rèn)參數(shù)可能會(huì)導(dǎo)致elasticsearch無(wú)法啟動(dòng)或者集群性能低下昆码。

注: 以上操作需要使用 root 用戶(hù)气忠,到目前為止操作系統(tǒng)環(huán)境已經(jīng)準(zhǔn)備完成邻储,以下開(kāi)始正式安裝赋咽,后面的操作如果不做特殊說(shuō)明均使用 elasticsearch 用戶(hù)

安裝jdk1.8

所有節(jié)點(diǎn)都需要安裝,安裝方式都一樣
解壓 jdk-8u172-linux-x64.tar.gz

tar zxvf jdk-8u172-linux-x64.tar.gz
mkdir -p /application/elasticsearch/app
mv jdk-8u172-linux-x64 /application/elasticsearch/app/jdk
rm -f jdk-8u172-linux-x64.tar.gz

配置環(huán)境變量
vi ~/.bash_profile 添加以下內(nèi)容:

#java
export JAVA_HOME=/application/elasticsearch/app/jdk
export CLASSPATH=.:$JAVA_HOME/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

加載環(huán)境變量

. ~/.bash_profile

查看是否安裝成功 java -version

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

如果出現(xiàn)以上結(jié)果證明安裝成功吨娜。

安裝elasticsearch

首先在pycdhnode1上安裝
解壓 elasticsearch-6.3.1.tar.gz

tar zxvf elasticsearch-6.3.1.tar.gz
mv elasticsearch-6.3.1 /application/elasticsearch/app/elasticsearch
rm -f elasticsearch-6.3.1.tar.gz

設(shè)置環(huán)境變量
vi ~/.bash_profile 添加以下內(nèi)容:

#elasticsearch
export ELASTICSEARCH_HOME=/application/elasticsearch/app/elasticsearch
export PATH=$PATH:$ELASTICSEARCH_HOME/bin

加載環(huán)境變量

. ~/.bash_profile

添加配置文件
vi /application/elasticsearch/app/elasticsearch/config/elasticsearch.yml

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# [https://www.elastic.co/guide/en/elasticsearch/reference/index.html](https://www.elastic.co/guide/en/elasticsearch/reference/index.html)
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#[cluster.name](http://cluster.name/): py_es_6.3
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#[node.name](http://node.name/): pyesnode-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# 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
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

#集群的名稱(chēng)
[cluster.name](http://cluster.name/): pyes6.3

#節(jié)點(diǎn)名稱(chēng),其余3個(gè)節(jié)點(diǎn)分別為pyesnode-2,pyesnode-3,pyesnode-4
[node.name](http://node.name/): pyesnode-1

#指定該節(jié)點(diǎn)是否有資格被選舉成為master節(jié)點(diǎn)脓匿,默認(rèn)是true,es是默認(rèn)集群中的第一臺(tái)機(jī)器為master宦赠,如果這臺(tái)機(jī)掛了就會(huì)重新選舉master
node.master: true

#允許該節(jié)點(diǎn)存儲(chǔ)數(shù)據(jù)(默認(rèn)開(kāi)啟)
node.data: true
#實(shí)際生產(chǎn)可以master節(jié)點(diǎn)和data數(shù)據(jù)分離

#索引數(shù)據(jù)的存儲(chǔ)路徑,多個(gè)目錄使用 , 分割
path.data: /application/elasticsearch/data/esdata

#日志文件的存儲(chǔ)路徑
path.logs: /application/elasticsearch/app/elasticsearch/logs

#設(shè)置為true來(lái)鎖住內(nèi)存陪毡。因?yàn)閮?nèi)存交換到磁盤(pán)對(duì)服務(wù)器性能來(lái)說(shuō)是致命的,當(dāng)jvm開(kāi)始swapping時(shí)es的效率會(huì)降低勾扭,所以要保證它不swap
#bootstrap.memory_lock: true
bootstrap.memory_lock: false
#服務(wù)器內(nèi)存小毡琉,設(shè)置允許使用swap

#綁定的ip地址
network.host: 0.0.0.0

#設(shè)置對(duì)外服務(wù)的http端口,默認(rèn)為9200
http.port: 9200

# 設(shè)置節(jié)點(diǎn)間交互的tcp端口,默認(rèn)是9300 
transport.tcp.port: 9300

#Elasticsearch將綁定到可用的環(huán)回地址妙色,并將掃描端口9300到9305以嘗試連接到運(yùn)行在同一臺(tái)服務(wù)器上的其他節(jié)點(diǎn)桅滋。

#這提供了自動(dòng)集群體驗(yàn),而無(wú)需進(jìn)行任何配置。數(shù)組設(shè)置或逗號(hào)分隔的設(shè)置丐谋。每個(gè)值的形式應(yīng)該是host:port或host
#(如果沒(méi)有設(shè)置芍碧,port默認(rèn)設(shè)置會(huì)transport.profiles.default.port 回落到transport.tcp.port)。
#請(qǐng)注意号俐,IPv6主機(jī)必須放在括號(hào)內(nèi)泌豆。默認(rèn)為127.0.0.1, [::1]
discovery.zen.ping.unicast.hosts: ["pycdhnode1:9300", "pycdhnode2:9300", "pycdhnode3:9300", "pycdhnode4:9300"]

#如果沒(méi)有這種設(shè)置,遭受網(wǎng)絡(luò)故障的集群就有可能將集群分成兩個(gè)獨(dú)立的集群 - 分裂的大腦 - 這將導(dǎo)致數(shù)據(jù)丟失,一般設(shè)置(N/2)+1
discovery.zen.minimum_master_nodes: 3

#為了使新加入的節(jié)點(diǎn)快速確定master位置吏饿,可以將data節(jié)點(diǎn)的默認(rèn)的master發(fā)現(xiàn)方式有multicast修改為unicast:選擇性配置
#discovery.zen.ping.multicast.enabled: false
#discovery.zen.ping.unicast.hosts: ["pycdhnode1", "pycdhnode2", "pycdhnode3", "pycdhnode4"]
  • 其中的 [node.name](http://node.name/) 配置每個(gè)節(jié)點(diǎn)必須不一樣

設(shè)置節(jié)點(diǎn)內(nèi)存使用量 vi /application/elasticsearch/app/elasticsearch/config/jvm.options

-Xms3g
-Xmx3g
  • 最小與最大必須設(shè)置一樣
  • 由于jvm內(nèi)存回收的原因踪危,當(dāng)內(nèi)存使用超過(guò)32G時(shí),性能會(huì)降低猪落,故每個(gè)節(jié)點(diǎn)推薦最高設(shè)置31G
  • elasticsearch 2.x 版本設(shè)置內(nèi)存使用在 $ELASTICSEARCH_HOME/bin/elasticsearch.in.sh中 ES_MIN_MEM=3g
    ES_MAX_MEM=3g

創(chuàng)建所需目錄

mkdir -p /application/elasticsearch/data/esdata

復(fù)制elasticsearch到pycdhnode2-4

scp ~/.bash_profile [pycdhnode2:/application/elasticsearch](http://pycdhnode2/application/elasticsearch)
scp ~/.bash_profile [pycdhnode3:/application/elasticsearch](http://pycdhnode3/application/elasticsearch)
scp ~/.bash_profile [pycdhnode4:/application/elasticsearch](http://pycdhnode4/application/elasticsearch)

scp -pr /application/elasticsearch/app/elasticsearch [pycdhnode2:/application/elasticsearch/app](http://pycdhnode2/application/elasticsearch/app)
scp -pr /application/elasticsearch/app/elasticsearch [pycdhnode3:/application/elasticsearch/app](http://pycdhnode3/application/elasticsearch/app)
scp -pr /application/elasticsearch/app/elasticsearch [pycdhnode4:/application/elasticsearch/app](http://pycdhnode4/application/elasticsearch/app)

ssh pycdhnode2 "mkdir -p /application/elasticsearch/data/esdata"
ssh pycdhnode3 "mkdir -p /application/elasticsearch/data/esdata"
ssh pycdhnode4 "mkdir -p /application/elasticsearch/data/esdata"
  • 修改pycdhnode1-4 /application/elasticsearch/app/elasticsearch/config/elasticsearch.yml 中的 [node.name](http://node.name/)
    pycdhnode1為:pyesnode-1 陨倡;pycdhnode2為:pyesnode-2 ;pycdhnode3為:pyesnode-3 许布;pycdhnode4為:pyesnode-4

優(yōu)化所有主機(jī)參數(shù)兴革,否則無(wú)法啟動(dòng)
vi /etc/sysctl.conf

vm.max_map_count=655360

生效

sysctl -p

vi /etc/security/limits.conf 添加以下內(nèi)容:

* soft nofile 65536
* hard nofile 65536 
* soft nproc 65536
* hard nproc 65536

vi /etc/security/limits.d/20-nproc.conf 添加以下內(nèi)容:

* soft nproc 65536
root soft nproc unlimited

重啟登錄 ulimit -a 查看是否生效

$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63488
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 65536
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

啟動(dòng)elasticsearch
4個(gè)節(jié)點(diǎn)均啟動(dòng)

/application/elasticsearch/app/elasticsearch/bin/elasticsearch -d
  • -d 后臺(tái)服務(wù)的方式啟動(dòng)
  • 如果啟動(dòng)異常,查看日志/application/elasticsearch/app/elasticsearch/logs/pyes6.3.log

查看進(jìn)程

jps

其中 Elasticsearch 進(jìn)程即為 elasticsearch

停止elasticsearch

kill pid

查看集群狀態(tài)

$ curl pycdhnode1:9200/_cat/health?v
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1531123674 16:07:54 pyes6.3 green 4 4 0 0 0 0 0 0 - 100.0%
  • es 集群一共3種狀態(tài): green 蜜唾, yellow 杂曲, red
  • 可以看到集群節(jié)點(diǎn)有4個(gè),集群狀態(tài)為 green袁余,正常

head插件安裝

ElasticSearch-head是一個(gè)H5編寫(xiě)的ElasticSearch集群操作和管理工具擎勘,可以對(duì)集群進(jìn)行傻瓜式操作。

  • 顯示集群的拓?fù)?并且能夠執(zhí)行索引和節(jié)點(diǎn)級(jí)別操作
  • 搜索接口能夠查詢(xún)集群中原始json或表格格式的檢索數(shù)據(jù)
  • 能夠快速訪問(wèn)并顯示集群的狀態(tài)
  • 有一個(gè)輸入窗口,允許任意調(diào)用RESTful API颖榜。這個(gè)接口包含幾個(gè)選項(xiàng),可以組合在一起以產(chǎn)生有趣的結(jié)果;
  • 5.0版本之前可以通過(guò)plugin安裝棚饵,直接解壓便可運(yùn)行,很綠色掩完,5.0之后安裝就需要使用nodejs噪漾,然后以獨(dú)立服務(wù)的方式啟動(dòng),不太方便且蓬,可以直接通過(guò)安裝谷歌瀏覽器插件 elasticsearch-head-chrome欣硼。

首先在es集群所有節(jié)點(diǎn)添加配置文件 vi /application/elasticsearch/app/elasticsearch/config/elasticsearch.yml

http.cors.enabled: true
http.cors.allow-origin: "*"

在pycdhnode1上面安裝,然后其他主機(jī)可以選裝恶阴,安裝方法一樣诈胜。

安裝NodeJS

wget [https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.5.0-linux-x64.tar.gz](https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.5.0-linux-x64.tar.gz)
tar zxvf node-v4.5.0-linux-x64.tar.gz
mv node-v4.5.0-linux-x64 app/node
rm -f node-v4.5.0-linux-x64.tar.gz

添加環(huán)境變量 vi ~/.bash_profile

#node
export NODE_HOME=/application/elasticsearch/app/node
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

加載環(huán)境變量

. ~/.bash_profile

安裝npm與grunt

npm install -g cnpm --registry=[https://registry.npm.taobao.org](https://registry.npm.taobao.org/)
npm install -g grunt
npm install -g grunt-cli --registry=[https://registry.npm.taobao.org](https://registry.npm.taobao.org/) --no-proxy

下載head插件并安裝

wget [https://github.com/mobz/elasticsearch-head/archive/master.zip](https://github.com/mobz/elasticsearch-head/archive/master.zip)
unzip master.zip
mv elasticsearch-head-master app

修改配置文件
vi /application/elasticsearch/app/elasticsearch-head-master/Gruntfile.js, 修改以下內(nèi)容

connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
  • 可以不修改,默認(rèn)監(jiān)聽(tīng)9100

繼續(xù)編輯 vi /application/elasticsearch/app/elasticsearch-head-master/_site/app.js, 修改以下內(nèi)容

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "[http://pycdhnode1:9200](http://pycdhnode1:9200/)";
  • 如不修改冯事,默認(rèn)連接 [http://pycdhnode1:9200焦匈,這里可以修改為集群任一主機(jī)](http://pycdhnode1:9200`%EF%BC%8C%E8%BF%99%E9%87%8C%E5%8F%AF%E4%BB%A5%E4%BF%AE%E6%94%B9%E4%B8%BA%E9%9B%86%E7%BE%A4%E4%BB%BB%E4%B8%80%E4%B8%BB%E6%9C%BA/)

下載依賴(lài)安裝

cd /application/elasticsearch/app/elasticsearch-head-master
npm install
  • 必須在head插件目錄中操作

啟動(dòng) head 插件
方法1:使用npm

cd /application/elasticsearch/app/elasticsearch-head-master
npm run start

方法2:直接使用grunt

cd /application/elasticsearch/app/elasticsearch-head-master
grunt server
  • 必須在head插件目錄中操作
  • npm 啟動(dòng)方式本質(zhì)上都是調(diào)用grunt啟動(dòng)
  • 兩種啟動(dòng)方式都不是后臺(tái)啟動(dòng),如需后臺(tái)運(yùn)行昵仅,請(qǐng)使用nohup

訪問(wèn) head:

http://pycdhnode1:9100/

停止 head:
首先通過(guò) ps aux|grep grunt 查找到進(jìn)程 pid 缓熟,然后 kill pid

ElasticHQ管理工具安裝

ElasticHQ 是一款開(kāi)源的具有良好體驗(yàn)、直觀和功能強(qiáng)大的 ElasticSearch 的管理和監(jiān)控工具。提供實(shí)時(shí)監(jiān)控荚虚、全集群管理薛夜、搜索和查詢(xún),無(wú)需額外軟件安裝版述。最新版本支持ElasticSearch 2.x, 5.x, 6.x梯澜。
特點(diǎn):
1、激活ES集群和節(jié)點(diǎn)實(shí)時(shí)監(jiān)控渴析;
2晚伙、管理索引、分片俭茧、映射咆疗、別名、節(jié)點(diǎn)母债;
3午磁、為多個(gè)索引查詢(xún)提供查詢(xún)UI;
4毡们、REST UI迅皇,不需要cURL和繁瑣的JSON格式;
5衙熔、100%基于瀏覽器登颓,不需下載軟件;
6红氯、免費(fèi)框咙;

ElasticHQ 是基于python的Django開(kāi)發(fā)的,最新版本的安裝需要python3.4以上痢甘,安裝與啟動(dòng)程序比較簡(jiǎn)單喇嘱,但要安裝python3.4以上環(huán)境比較麻煩,故我們直接采用官方提供的docker容器安裝产阱,簡(jiǎn)單方便

首先在pull最新官方鏡像

docker pull elastichq/elasticsearch-hq

啟動(dòng)容器

docker run -d -p 9999:5000 --name es elastichq/elasticsearch-hq

訪問(wèn)

http://IP:9999

  • 打開(kāi)首頁(yè)后在輸入框輸入es集群隨意一臺(tái)節(jié)點(diǎn)地址確認(rèn)即可

更多詳情參見(jiàn):https://github.com/ElasticHQ/elasticsearch-HQ

kibana安裝

Kibana 是一個(gè)開(kāi)源的分析和可視化平臺(tái)婉称,旨在與 Elasticsearch 合作块仆。Kibana 提供搜索构蹬、查看和與存儲(chǔ)在 Elasticsearch 索引中的數(shù)據(jù)進(jìn)行交互的功能。開(kāi)發(fā)者或運(yùn)維人員可以輕松地執(zhí)行高級(jí)數(shù)據(jù)分析悔据,并在各種圖表庄敛、表格和地圖中可視化數(shù)據(jù)。

kibana本身只提供單點(diǎn)安裝科汗,如果想避免單點(diǎn)故障藻烤,需要結(jié)合lvs,haproxy,nginx等負(fù)載均衡軟件實(shí)現(xiàn)高可用怖亭,在這里我們 只在pycdhnode1上面安裝涎显,然后其他主機(jī)可以選裝,安裝方法一樣兴猩。

安裝kibana

tar -zxvf kibana-6.3.1-linux-x86_64.tar.gz
mv kibana-6.3.1-linux-x86_64 app/kibana
rm -f kibana-6.3.1-linux-x86_64.tar.gz

添加環(huán)境變量 vi ~/.bash_profile

#kibana
export KIBANA_HOME=/application/elasticsearch/app/kibana
export PATH=$PATH:$KIBANA_HOME/bin

加載環(huán)境變量

. ~/.bash_profile

配置文件 vi /application/elasticsearch/app/kibana/config/kibana.yml

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
# 監(jiān)聽(tīng)端口

# 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"
# 監(jiān)聽(tīng)地址

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

# Specifies whether Kibana should rewrite requests that are prefixed with
# `server.basePath` or require that they are rewritten by your reverse proxy.
# This setting was effectively always `false` before Kibana 6.3 and will
# default to `true` starting in Kibana 7.0.
#server.rewriteBasePath: false

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name. This is used for display purposes.
[server.name](http://server.name/): "pycdhnode1"

# The URL of the Elasticsearch instance to use for all your queries.
elasticsearch.url: "[http://pycdhnode1:9200](http://pycdhnode1:9200/)"
# es連接地址期吓,只能配置一個(gè)節(jié)點(diǎn)地址,如果需要高可用倾芝,需要es集群配合lvs讨勤,haproxy負(fù)載均衡提供

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# The default application to load.
#kibana.defaultAppId: "home"

# 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: "user"
#elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#server.ssl.enabled: false
#server.ssl.certificate: /path/to/your/server.crt
#server.ssl.key: /path/to/your/server.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files validate that your Elasticsearch backend uses the same key files.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
#elasticsearch.ssl.certificateAuthorities: [ "/path/to/your/CA.pem" ]

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#elasticsearch.ssl.verificationMode: full

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-side
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid

# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
#ops.interval: 5000

# The default locale. This locale can be used in certain circumstances to substitute any missing
# translations.
#i18n.defaultLocale: "en"

xpack.security.enabled: false
# 關(guān)閉xpack驗(yàn)證;由于集群為配置xpack晨另,故必須關(guān)閉潭千,否則無(wú)法正常連接es集群

啟動(dòng) kibana
方法1:控制臺(tái)啟動(dòng)

kibana
  • 退出回話或者 ctrl + c 會(huì)退出

方法2:使用nohup后臺(tái)啟動(dòng)

cd /application/elasticsearch/app/kibana
mkdir logs
nohup kibana > logs/server.log 2>&1 &

訪問(wèn) kibana:

http://pycdhnode1:5601/

停止 kibana:
首先通過(guò) ps aux|grep kibana 查找到進(jìn)程 pid ,然后 kill pid

更多kibana使用方法參考官網(wǎng):https://www.elastic.co/guide/en/kibana/6.3/index.html

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末借尿,一起剝皮案震驚了整個(gè)濱河市刨晴,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌路翻,老刑警劉巖割捅,帶你破解...
    沈念sama閱讀 212,718評(píng)論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異帚桩,居然都是意外死亡亿驾,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,683評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門(mén)账嚎,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)莫瞬,“玉大人,你說(shuō)我怎么就攤上這事郭蕉√垩” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 158,207評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵召锈,是天一觀的道長(zhǎng)旁振。 經(jīng)常有香客問(wèn)我,道長(zhǎng)涨岁,這世上最難降的妖魔是什么拐袜? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 56,755評(píng)論 1 284
  • 正文 為了忘掉前任,我火速辦了婚禮梢薪,結(jié)果婚禮上蹬铺,老公的妹妹穿的比我還像新娘。我一直安慰自己秉撇,他們只是感情好甜攀,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,862評(píng)論 6 386
  • 文/花漫 我一把揭開(kāi)白布秋泄。 她就那樣靜靜地躺著,像睡著了一般规阀。 火紅的嫁衣襯著肌膚如雪恒序。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 50,050評(píng)論 1 291
  • 那天谁撼,我揣著相機(jī)與錄音奸焙,去河邊找鬼。 笑死彤敛,一個(gè)胖子當(dāng)著我的面吹牛与帆,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播墨榄,決...
    沈念sama閱讀 39,136評(píng)論 3 410
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼玄糟,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了袄秩?” 一聲冷哼從身側(cè)響起阵翎,我...
    開(kāi)封第一講書(shū)人閱讀 37,882評(píng)論 0 268
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎之剧,沒(méi)想到半個(gè)月后郭卫,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,330評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡背稼,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,651評(píng)論 2 327
  • 正文 我和宋清朗相戀三年贰军,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片蟹肘。...
    茶點(diǎn)故事閱讀 38,789評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡词疼,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出帘腹,到底是詐尸還是另有隱情贰盗,我是刑警寧澤,帶...
    沈念sama閱讀 34,477評(píng)論 4 333
  • 正文 年R本政府宣布阳欲,位于F島的核電站舵盈,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏球化。R本人自食惡果不足惜秽晚,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,135評(píng)論 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望赊窥。 院中可真熱鬧爆惧,春花似錦、人聲如沸锨能。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,864評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)址遇。三九已至熄阻,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間倔约,已是汗流浹背秃殉。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,099評(píng)論 1 267
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留浸剩,地道東北人钾军。 一個(gè)月前我還...
    沈念sama閱讀 46,598評(píng)論 2 362
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像绢要,于是被迫代替她去往敵國(guó)和親吏恭。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,697評(píng)論 2 351

推薦閱讀更多精彩內(nèi)容