1、配置JAVA环境,最新版
.........省略.........
普通用户不生效的话,重启reboot
2、安装
下载zip文件elasticsearch-5.4.0.zip
unzip elasticsearch-5.4.0.zip
cd elasticsearch-5.4.0
3、启动
./bin/elasticsearch -d
-d 参数台运行
4、测试
curl ‘http://localhost:9200/‘
看到以下信息说明启动成功
{
"name" : "MkBlpSX",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "7OoxnHQgRqmu2p-8VsGlXA",
"version" : {
"number" : "5.4.0",
"build_hash" : "780f8c4",
"build_date" : "2017-04-28T17:43:27.229Z",
"build_snapshot" : false,
"lucene_version" : "6.5.0"
},
"tagline" : "You Know, for Search"
}
5、客户端测试
显示“无法访问”得需求修改配置文件
vi config/elasticsearch.yml
6、重启服务,出现:
max file descriptors [4096] for elasticsearchprocess likely too low, increase to at least [65536]
解决:
vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096
vi /etc/security/limits.d/20-nproc.conf
修改如下内容:
* soft nproc 4096
#修改为
* soft nproc 65536
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
然后,再启动elasticsearch,即可启动成功。
再,本地测试与客户端测试:进行对比
curl ‘http://localhost:9200‘
http://192.168.137.7:9200/
7、安装elasticsearch-head
.............待续...........