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

discovery.seed_hosts: ["127.0.0.1"]

cluster.initial_master_nodes: ["node-1"]
 

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

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在Linux部署Elasticsearch 8.0.0版本的步骤: 1. 下载Elasticsearch 8.0.0版本的压缩包,可以从官网下载或使用命令行下载: ``` wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.0.0-linux-x86_64.tar.gz ``` 2. 解压缩该文件: ``` tar -xzvf elasticsearch-8.0.0-linux-x86_64.tar.gz ``` 3. 进入解压后的目录: ``` cd elasticsearch-8.0.0/ ``` 4. 配置Elasticsearch,修改config/elasticsearch.yml文件来设置Elasticsearch的配置。例如: ``` cluster.name: my_cluster node.name: my_node network.host: 0.0.0.0 http.port: 9200 ``` 5. 安装JDK,Elasticsearch 8.0.0需要使用至少Java 16.0.1版本。可以通过以下命令安装: ``` sudo apt-get install openjdk-16-jdk ``` 6. 启动Elasticsearch: ``` ./bin/elasticsearch ``` 7. 验证Elasticsearch是否启动成功,可以在浏览器中输入以下地址: ``` http://localhost:9200/ ``` 如果看到类似以下输出,则表示Elasticsearch已经成功启动: ``` { "name" : "my_node", "cluster_name" : "my_cluster", "cluster_uuid" : "XXXXX", "version" : { "number" : "8.0.0", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "XXXX", "build_date" : "2021-11-15T18:13:45.804682922Z", "build_snapshot" : false, "lucene_version" : "11.1.0", "minimum_wire_compatibility_version" : "7.14.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search" } ``` 以上就是在Linux部署Elasticsearch 8.0.0版本的步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值