安装Elasticsearch
mkdir /opt/software/elasticsearch/data/
mkdir /opt/software/elasticsearch/logs/
chmod 777 /opt/software/elasticsearch/data/
useradd elasticsearch
passwd elasticsearch
chown -R elasticsearch elasticsearch/
vim /etc/security/limits.conf
添加如下内容:*
soft nofile 65536*
hard nofile 131072*
soft nproc 2048*
hard nproc 4096
进入limits.d目录下修改配置文件
vim /etc/security/limits.d/90-nproc.conf
修改如下内容:
soft nproc 4096(修改为此参数,6版本的默认就是4096)
修改配置sysctl.conf
vim /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
hadoop1的conf配置
elasticsearch.yml
cluster.name: xz_es
node.name: node-1
node.master: true
node.data: true
path.data: /opt/software/elasticsearch/data
path.logs: /opt/software/elasticsearch/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.116.201
discovery.zen.ping.unicast.hosts: ["hadoop1", "hadoop2", "hadoop3"]
jvm.options
修改下
-Xms64m
-Xmx64m
hadoop2的conf配置
elasticsearch.yml
cluster.name: xz_es
node.name: node-2
node.master: false
node.data: true
path.data: /opt/software/elasticsearch/data
path.logs: /opt/software/elasticsearch/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.116.202
discovery.zen.ping.unicast.hosts: ["hadoop1", "hadoop2", "hadoop3"]
jvm.options
修改下
-Xms64m
-Xmx64m
hadoop3的conf配置
elasticsearch.yml
cluster.name: xz_es
node.name: node-3
node.master: false
node.data: true
path.data: /opt/software/elasticsearch/data
path.logs: /opt/software/elasticsearch/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.116.203
discovery.zen.ping.unicast.hosts: ["hadoop1", "hadoop2", "hadoop3"]
jvm.options
修改下
-Xms64m
-Xmx64m
Kibana的conf配置
kibana.yml
server.port: 5601
server.host: "192.168.116.202"
elasticsearch.url: "http://192.168.116.201:9200"
运行Elasticsearch
cd /opt/software/elasticsearch
su elasticsearch
bin/elasticsearch &
运行Kibana
cd /opt/software/kibana/
bin/kibana &