下载并解压缩,命令行前不要留空格
官方下载地址:https://www.php.cn/link/88a9225cf17ea3bf8bef2b4658ef7bf2
下载链接:https://www.php.cn/link/fc64088b0f734c47f016d7a69cc53333

解压命令:tar -zxvf elasticsearch-8.2.0-linux-x86_64.tar.gz
切换到目录:cd /usr/local/elasticsearch-8.2.2/bin/
启动Elasticsearch:./elasticsearch
[root@VM-4-3-centos bin]# ./elasticsearch
创建es用户
[root@VM-4-3-centos ~]# useradd es
[root@VM-4-3-centos ~]# passwd es
[root@VM-4-3-centos ~]# id es
uid=1001(es) gid=1001(es) groups=1001(es)
如果使用root账号启动Elasticsearch会报错:java.lang.RuntimeException: can not run elasticsearch as root
使用root账号创建用户:sudo adduser es
设置密码:sudo passwd es
对es用户授权,目录elasticsearch-8.2.0(重要):sudo chown -R es:es elasticsearch-8.2.0
切换es账号并启动服务
su es
./bin/elasticsearch
后台运行,避免客户端退出后服务停止:./bin/elasticsearch -d
帮衣帮-AI服装设计
AI服装设计神器,AI生成印花、虚拟试衣、面料替换
106 查看详情
当看到“started”时,服务已成功启动
关闭ES服务:kill pid
说明:Elasticsearch使用9300和9200端口,其中9300为tcp通讯端口,用于集群节点间通信,9200为http协议的RESTful接口
启动时报错,调整配置文件属性
解决内存不足问题:启动时卡住,可能是由于Elasticsearch默认分配的JVM空间大小为2g。修改JVM空间大小,如果Linux服务器配置较高,可以不做修改。
修改JDK启动内存:vim /usr/local/elasticsearch-8.2.0/config/jvm.options
-Xms256m-Xmx256m
报错:Native controller process has stopped – no new native processes can be started
继续配置文件:sudo vim /etc/security/limits.conf
* soft nofile 262144* hard nofile 131072* soft nproc 4096* hard nproc 4096
报错信息:
bootstrap check failure [1] of [3]: max number of threads [2048] for user [es] is too low, increase to at least [4096]
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
soft nproc:单个用户可用的最大进程数量(超过会警告);hard nproc:单个用户可用的最大进程数量(超过会报错);soft nofile:可打开的文件描述符的最大数(超过会警告);hard nofile:可打开的文件描述符的最大数(超过会报错)
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
在es bin目录执行:vim ../config/elasticsearch.yml
修改配置文件:
cluster.name: es.studynode.name: node-1network.host: 0.0.0.0http.port: 9200bootstrap.memory_lock: false#system_call_filter启动报错,去掉#bootstrap.system_call_filter: false# 为Elasticsearch设置登录密码xpack.security.enabled: falsecluster.initial_master_nodes: ["node-1"]# error downloading geoip database [GeoLite2-Country.mmdb]#关闭geoip数据库的更新ingest.geoip.downloader.enabled: false
其他



以上就是linux elasticsearch-8.2.0安装的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/452487.html
微信扫一扫
支付宝扫一扫