【es】CentOS搭建Elasticsearch及配置

1.解压安装
tar -zxvf elasticsearch-1.7.1.tar.gz
mv elasticsearch-1.7.1 /data/elasticsearch
2.修改配置文件
vi /data/elasticsearch/config/elasticsearch.yml

修改以下参数

cluster.name: elasticsearch
network.publish_host: 122.224.52.69
network.host: 0.0.0.0
#discovery.zen.ping.unicast.hosts: ["192.168.1.91"]
3.修改/etc/sysctl.conf
 
vi /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p
 
4.修改/etc/security/limits.conf
vi /etc/security/limits.conf
python soft nofile 65536
python hard nofile 65536
python soft nproc 4096
python hard nproc 4096
 
5.启动
cd /data/elasticsearch/bin
./elasticsearch -d
 
6.测试
curl -XGET 'http://192.168.1.91:9200/'
{
"status" : 200,
"name" : "Garrison Kane",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.7.1",
"build_hash" : "b88f43fc40b0bcd7f173a1f9ee2e97816de80b19",
"build_timestamp" : "2015-07-29T09:54:16Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4" },
"tagline" : "You Know, for Search"
}
 
7.添加管理页面密码
 
修改配置文件elasticsearch.yml,添加如下参数
http.basic.enabled:  true
http.basic.user:  "admin"
http.basic.password: "1234qwer"
http.basic.ipwhitelist:  ["localhost", "127.0.0.1"]
http.basic.trusted_proxy_chains:  []
http.basic.log:   false
http.basic.xforward:  ""

猜你喜欢

转载自blog.csdn.net/xiaren_1988/article/details/115069712