elasticsearch-5.5.3 配置外网访问9200端口
程序员文章站
2022-03-24 11:03:00
...
下载解压缩安装elasticsearch,然后sh ./bin/elasticsearch 启动,但是其他机器看不了9200端口,只能本机127.0.0.1访问。
需要修改config下的elasticsearch.yml,添加或修改
写道
network.host: 0.0.0.0
http.port: 9200
http.port: 9200
然后重新启动elasticsearch ,会报错
①max file descriptors.......
修改/etc/security/limits.conf,添加或者修改如下(切换root用户)
写道
* hard nofile 65536
* soft nofile 65536
* soft nofile 65536
“*”星号不要少,不让无效,改完后重新登录下或者sudo sysctl -p /etc/security/limits.conf 让它生效,可以用命令
写道
ulimit -Hu
ulimit -Su
ulimit -Su
查看是否生效。
②max virtual memory.......
修改/etc/sysctl.conf 添加vm.max_map_count=2621441
保存后执行sudo sysctl -p /etc/sysctl.conf 使之生效
然后启动es,外网就可以访问了 ,如果还不能看看是不是防火墙的问题
访问9200端口会显示
写道
{
"name" : "EX9AIWS",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "1qosQ8lIQwyYz0ufxUEZiA",
"version" : {
"number" : "5.5.3",
"build_hash" : "9305a5e",
"build_date" : "2017-09-07T15:56:59.599Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}
"name" : "EX9AIWS",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "1qosQ8lIQwyYz0ufxUEZiA",
"version" : {
"number" : "5.5.3",
"build_hash" : "9305a5e",
"build_date" : "2017-09-07T15:56:59.599Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}