linux部署es8.0版本以及启动了浏览器访问不了

下载地址

https://www.elastic.co/cn/downloads/past-releases/elasticsearch-8-0-0

解压安装包

tar -zxvf elasticsearch-8.0.0-linux-x86_64.tar.gz

移动到指定文件夹

mv elasticsearch-8.0.0 /usr/local/elasticsearch-8.0

进入文件夹

cd /usr/local/elasticsearch-8.0/

新建data和log文件夹用于存放数据

mkdir data

mkdir log
进入config文件夹

cd config/

修改elasticsearch.yml

vim elasticsearch.yml

path.logs: /usr/local/elasticsearch-8.0/log

#开启xpack

xpack.security.enabled: false

xpack.security.transport.ssl.enabled: false

#允许跨域

http.cors.enabled: true

http.cors.allow-origin: "*"

http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length

#配置

network.host: 0.0.0.0

http.port: 9200

cd /usr/local/elasticsearch-8.0/bin/

启动

./elasticsearch

1

出现错误:

因为es默认不能用root用户启动,也不推荐使用root启动es,通常需要去创建一个新用户

adduser es

passwd es

chown -R es:es /usr/local/elasticsearch-8.0/

chmod 770 /usr/local/elasticsearch-8.0/

切换用户,重新启动es

su es

./elasticsearch

开放端口:

firewall-cmd --zone=public --add-port=9200/tcp --permanent

firewall-cmd --reload

访问
#ip是配置文件中network.host

http://127.0.0.1:9200/

会报错
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

ERROR: Elasticsearch did not exit normally - check the logs at /usr/local/elasticsearch-8.0/log/es8.log

主要是文件权限与内存大小问题:

elasticsearch用户拥有的可创建文件描述的权限太低,至少需要65536,

#切换到root用户修改

vim /etc/security/limits.conf # 在最后面追加下面内容

es hard nofile 65536

es soft nofile 65536 #es是启动elasticsearch的用户

max_map_count文件包含限制一个进程可以拥有的VMA(虚拟内存区域)的数量

#切换到root用户修改

vim /etc/sysctl.conf # 在最后面追加下面内容

vm.max_map_count=655360

执行 sysctl -p

相关推荐
2023自学中1 小时前
imx6ull 开发板,手机,MQTT 物联网通信实验。
linux·服务器·物联网·嵌入式·开发板·应用编程
f8979070701 小时前
把文件进行锁死,不要有写的权限。不被恶意攻击
linux
用户2367829801681 小时前
Linux kill 命令:从信号机制到进程管理的深度解析
linux
00后程序媛1 小时前
ubuntu安装qemu和xv6
linux·运维·ubuntu
载数而行5201 小时前
Linux操作系统 5 组管理,权限管理
linux
疯狂打码的少年2 小时前
Cache的三种映射方式(直接/全相联/组相联)
linux·服务器·数据库·笔记
阿狸猿2 小时前
论系统负载均衡设计方法
运维·负载均衡
minji...2 小时前
Linux 高级IO(四)多路转接之epoll,epoll 模型及原理
linux·运维·服务器·多路转接·epoll·epoll模型·红黑树/就绪队列/回调
蜡笔婧萱2 小时前
网络服务综合大实验--包含NFS服务器,Web服务器,DNS域名服务器
linux·服务器·网络
bitbrowser2 小时前
2026年Facebook广告账户频频“连坐”被封?聊聊出海投流
运维·服务器·facebook