admin管理员组文章数量:1624792
接上一篇,linux centos7 安装好elasticsearch后,只能curl localhost:9200访问,如果用ip是访问不了,因此这篇解决这个问题
[root@localhost ~]# curl 192.168.100.130:9200
curl: (7) Failed connect to 192.168.100.130:9200; Connection refused
文章目录
- 改es的config的配置文件elasticsearch.yml
- 参考资料
改es的config的配置文件elasticsearch.yml
vim elasticsearch.yml
network.host: 192.168.100.130
http.port: 9200
启动
./elasticsearch
报错
ERROR: [3] bootstrap checks failed. You must address the points described in the following [3] lines before starting Elasticsearch.
bootstrap check failure [1] of [3]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
bootstrap check failure [3] of [3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
解决方法
使用root身份
vim /etc/security/limits.conf
最后添加内容,es为上一篇创建的用户名
es soft nofile 65536
es hard nofile 131072
es soft nproc 4096
es hard nproc 4096
继续配置
sysctl -w vm.max_map_count=262144
vim /etc/sysctl.conf
在文末添加
vm.max_map_count=262144
继续配置 在config文件夹里加
vim config/elasticsearch.yml
编辑文本
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
重启
继续报错
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
继续更改config/elasticsearch.yml配置
#配置以下三者,最少其一
#[discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes]
cluster.initial_master_nodes: ["node-1"] #这里的node-1为node-name配置的值
重新启动,启动成功了
现在可以访问了
[root@localhost ~]# curl 192.168.100.130:9200
{
"name" : "localhost.localdomain",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "vndxxZbCSIO58HZw8K3P1Q",
"version" : {
"number" : "7.16.3",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "4e6e4eab2297e949ec994e688dad46290d018022",
"build_date" : "2022-01-06T23:43:02.825887787Z",
"build_snapshot" : false,
"lucene_version" : "8.10.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
参考资料
Linux系统下安装 Elasticsearch 6.XX 外网无法访问的问题
[[1]: the default discovery settings are unsuitable for production use; at least one of discovery.se
本文标签: LinuxipElasticsearch
版权声明:本文标题:linux centos7 elasticsearch固定ip访问 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1728912418a1179279.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论