栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

linux centos7 elasticsearch固定ip访问

linux centos7 elasticsearch固定ip访问

接上一篇,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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/720804.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号