开启远程访问
# 1.默认ES无法使用主机ip进行远程连接,需要开启远程连接权限
- 修改ES安装包中config/elasticsearch.yml配置文件
$ vim elasticsearch.yml
# 2.重新启动ES服务
- ./elasticsearch
- 启动出现如下错误:
`bootstrap check failure [1] of [4]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
`bootstrap check failure [2] of [4]: max number of threads [3802] for user [chenyn] is too low, increase to at least [4096]
`bootstrap check failure [3] of [4]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
`bootstrap check failure [4] of [4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers
# 3.解决错误-1
文章来源:https://www.toymoban.com/news/detail-510253.html
$ vim /etc/security/limits.conf
# 在最后面追加下面内容
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
# 退出重新登录检测配置是否生效:
ulimit -Hn
ulimit -Sn
ulimit -Hu
ulimit -Su
# 3.解决错误-2
#进入limits.d目录下修改配置文件。
$ vim /etc/security/limits.d/20-nproc.conf
# 修改为
启动ES用户名 soft nproc 4096
# 3.解决错误-3
# 编辑sysctl.conf文件
$ vim /etc/sysctl.conf
vm.max_map_count=655360 #centos7 系统
vm.max_map_count=262144 #ubuntu 系统
# 执行以下命令生效:
$ sysctl -p
# 3.解决错误-4
# 编辑elasticsearch.yml配置文件
$ vim conf/elasticsearch.yml
cluster.initial_master_nodes: ["node-1"]
文章来源地址https://www.toymoban.com/news/detail-510253.html
# 4.重启启动ES服务,并通过浏览器访问
{
"name": "localhost.localdomain",
"cluster_name": "elasticsearch",
"cluster_uuid": "OWh3xLYwR-6lZ_fQNhVY3A",
"version": {
"number": "7.14.0",
"build_flavor": "default",
"build_type": "tar",
"build_hash": "dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1",
"build_date": "2021-07-29T20:49:32.864135063Z",
"build_snapshot": false,
"lucene_version": "8.9.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
到了这里,关于ElasticSearch开启远程连接的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!