1、安装jdk8
2、下载es5
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.1.zip
3、解压 赋权限 chmod -R 777 /usr/local/elk5/
4、vim config/jvm.options
-Xms256m
-Xmx256m
5、vim config/elasticsearch.yml
主节点
cluster.name: es-cluster
node.name: es-node-a1
node.master: true
node.data: true
path.logs: /usr/local/elk/elasticsearch/logs
bootstrap.memory_lock: false
network.host: 192.168.95.150
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.95.150", "192.168.95.151", "192.168.95.152"]
discovery.zen.minimum_master_nodes: 1
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
gateway.expected_nodes: 1
bootstrap.system_call_filter: false
script.engine.groovy.inline.search: on
script.engine.groovy.inline.aggs: on
indices.recovery.max_bytes_per_sec: 20mb
http.cors.enabled: true
http.cors.allow-origin: "*"
从节点
cluster.name: es-cluster
node.name: es-node-a2
node.master: false
node.data: true
path.logs: /usr/local/elk/elasticsearch/logs
bootstrap.memory_lock: false
network.host: 192.168.95.152
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.95.150", "192.168.95.151", "192.168.95.152"]
discovery.zen.minimum_master_nodes: 1
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
gateway.expected_nodes: 1
bootstrap.system_call_filter: false
script.engine.groovy.inline.search: on
script.engine.groovy.inline.aggs: on
indices.recovery.max_bytes_per_sec: 20mb
6、vim /etc/sysctl.conf
#添加下面2行
vm.max_map_count=655360
fs.file-max=655360
执行sysctl -p 使其生效
7、vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
wanbf soft memlock unlimited
wanbf hard memlock unlimited
* soft nproc 5000
* hard nproc 5000
wanbf soft nproc 5000
wanbf hard nproc 5000
8、修改limit文件需要重启机器执行 shutdown -r now
9、运行 bin/elasticsearch
10、es会改变防火墙状态 需要root去执行 service iptables stop
二、es header部署
11、git安裝
yum remove git
# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.0.5.tar.gz
# tar xzf git-2.0.5.tar.gz
# cd git-2.0.5
yum install perl-ExtUtils-MakeMaker package
yum install libssl-dev build-essential zlibc zlib-bin libidn11-dev libidn11
yum install libssl-dev openssl-devel
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
git --version
12、安裝node js
wget https://npm.taobao.org/mirrors/node/v6.11.3/node-v6.11.3-linux-x64.tar.gz
tar -zvxf node-v6.11.0-linux-x64.tar.gz
vi /etc/profile
export NODE_HOME=/opt/node
export PATH=$NODE_HOME/bin:$PATH
source /etc/profile
node -v
13、启动es-head
cd elaticsearch-head
npm install
npm run start
open http://localhost:9100/