1.安装JDK(1.8)
2.上传解压Elasticsearch-5.4.3
mkdir /bigdata mkdir /data tar -zxvf elasticsearch-5.4.3.tar.gz -C /bigdata
3.创建一个普通用户,然后将对于的目录修改为普通用户的所属用户和所属组
useradd wang passwd wang 123456 123456 chown -R wang:123456 /bigdata chown -R wang:123456 /data 登录wang的用户 whoami
4.修改配置文件config/elasticsearch.yml
network.host: 192.168.52.206
vi /bigdata/elasticsearch-5.4.3/config/elasticsearch.yml
5.启动ES,发现报错
bin/elasticsearch -d 后台启动
出现错误
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
用户最大可创建文件数太小
sudo vi /etc/security/limits.conf
- soft nofile 65536
- hard nofile 65536
查看可打开文件数量
ulimit -Hn
最大虚拟内存太小
sudo vi /etc/sysctl.conf vm.max_map_count=262144
查看虚拟内存的大小
sudo sysctl -p
6.重启linux
shutdown -r now
7.通过浏览器访问ES
192.168.52.206:9200
8.集群安装
vi /bigdata/elasticsearch-5.4.3/config/elasticsearch.yml cluster.name: my-es node.name:hadoop7 path.data: /data/es/data path/logs: /data/es/logs discovery.zen.ping.unicast.hosts: ["hadoop6", "hadoop7","hadoop8"]
9.拷贝到其他集群机器
scp elasticsearch.yml hadoop7/8:$PWD