1. 下载软件
- 下载elasticsearch-2.2.0的tar包:https://www.elastic.co/downloads/past-releases/elasticsearch-2-2-0
- 下载kibana-4.4.1-linux-x64的tar包:https://www.elastic.co/downloads/past-releases/kibana-4-4-1
2. 安装elasticsearch
2.1 解压
# tar -zxvf elasticsearch-2.2.0.tar.gz -C /opt/modules/
# cd /opt/modules/elasticsearch-2.2.0/
2.2 修改elasticsearch.yml文件
# vim config/elasticsearch.yml
a) cluster.name (同一集群要一样)
cluster.name: chenkl
b) node.name (同一集群要不一样)
node.name: node-1
c) network.host
network.host: 192.168.9.86
d) # 防止脑裂的配置
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: 192.168.9.86
2.3 elasticsearch-servicewrapper
- 下载elasticsearch-servicewrapper:https://github.com/elastic/elasticsearch-servicewrapper
- 拷贝service至ES_HOME/bin/
# cp -r ./service/ /opt/modules/elasticsearch-2.2.0/bin/
- 修改elasticsearch.conf文件,配置jvm的内存
# vim bin/service/elasticsearch.conf
set.default.ES_HEAP_SIZE=1024
- 安装启动服务
# cd /opt/modules/elasticsearch-2.2.0/
# ./bin/service/elasticsearch install
3. 安装kibana
3.1 解压
# tar -zxvf kibana-4.4.1-linux-x64.tar.gz -C /opt/modules/kibana/
# cd /opt/modules/kibana/kibana-4.4.1-linux-x64/
3.2, 修改kibana.yml文件
# vim config/kibana.yml
elasticsearch.url: "http://192.168.9.86:9200"
4. 安装插件
4.1 head插件
# cd /opt/modules/elasticsearch-2.2.0/
# ./bin/plugin install mobz/elasticsearch-head
4.2 sense插件
# cd /opt/modules/kibana/kibana-4.4.1-linux-x64/
# ./bin/kibana plugin --install elastic/sense
5. 启动 service elasticsearch kibana
- 启动service
# chown -R jerry:jerry /opt/modules/elasticsearch-2.2.0/
# su jerry
$ cd /opt/modules/elasticsearch-2.2.0/
$ bin/service/elasticsearch start
- 启动elasticsearch
$ cd /opt/modules/elasticsearch-2.2.0/
$ ./bin/elasticsearch &
- 启动kibana
su root
# cd /opt/modules/kibana/kibana-4.4.1-linux-x64/
# ./bin/kibana &
6. Web UI访问
http://192.168.9.86:5601/app/sense