linux安装elasticsearch 7.8

网友投稿 656 2022-05-29

安装参考文档:

ELK官网:https://www.elastic.co/

linux安装elasticsearch 7.8

ELK官网文档:https://www.elastic.co/guide/index.html

ELK中文手册:https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html

ELK中文社区:https://elasticsearch.cn/

ELK-API : https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html

下载软件

下载地址:https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-8-0

命令下载:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.0-linux-x86_64.tar.gz

1

创建存储文件:

mkdir /itcast/es/

1

解压到这个文件里面去:

tar -xvf elasticsearch-7.8.0-linux-x86_64.tar.gz -C /itcast/es/

1

修改配置文件:

[root@VM-4-15-centos ~]# cd /itcast/es/elasticsearch-7.8.0/ [root@VM-4-15-centos elasticsearch-7.8.0]# vim config/elasticsearch.yml

1

2

修改以下主要内容:

以下是我遇到了了全部错误后配置的全部内容

#设置ip地址,任意网络均可访问 network.host: 0.0.0.0 http.port: 9200 transport.tcp.port: 9300 node.name: "node-1" discovery.seed_hosts: ["127.0.0.1", "[::1]"] cluster.initial_master_nodes: ["node-1"] # # 开启跨域访问支持,默认为false http.cors.enabled: true # 跨域访问允许的域名地址,(允许所有域名)以上使用正则 http.cors.allow-origin: "*" http.max_content_length: 200mb bootstrap.system_call_filter: false

1

2

3

4

5

6

7

8

9

10

11

12

13

说明:在Elasticsearch中如果,如果network.host不是localhost或者127.0.0.1的话,就会认为是生产环境,会对环境的要求比较高,我们的测试环境不一定能够满足,一般情况下需要修改2处配置

修改jvm启动参数

[root@VM-4-15-centos elasticsearch-7.8.0]# vim config/jvm.options #可以根据自己机器情况修改 -Xms128m -Xmx128m

1

2

3

4

5

修改一个进程在VMAS(虚拟内存区域)创建内存映射最大数量

[root@VM-4-15-centos ~]# vim /etc/sysctl.conf vm.max_map_count=655360

1

2

让配置生效

sysctl -p

1

因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户elsearch 。

useradd elsearch

1

为用户赋elasticsearch-7.8.0这个文件的操作权限

chown -R elsearch:elsearch /itcast/es/elasticsearch-7.8.0/

1

启动es服务

su - elsearch cd /itcast/es/elasticsearch-7.8.0/bin ./elasticsearch 或 ./elasticsearch -d#后台系统

1

2

3

启动成功后通过ip加上端口号9200就可以访问了,如果是云服务器记得在防火墙那里开启端口9200

错误

参考:https://www.cnblogs.com/socketqiang/p/11363024.html

因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户。

ERROR: [1] bootstrap checks failed [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 ERROR: Elasticsearch did not exit normally - check the logs at /itcast/es/elasticsearch-7.8.0/logs/elasticsearch.log

1

2

3

解决:https://blog.csdn.net/qq_43655835/article/details/104637625

Elasticsearch Linux

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:PostgreSQL — 外键关联操作
下一篇:UWB 超宽带全向平面天线
相关文章