您现在的位置是:网站首页> 编程开发> 大数据 编程开发

elasticsearch 8.1.2安装及使用

2022-04-18大数据 6303人已围观

简介elasticsearch安装 : https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz 1 tar -xvf xx.tar.gz #解压软件包  2 3 vim config/elastics

elasticsearch 8.1.2安装及使用

最后更新:2022-04-18 17:19:55

推荐指数


elasticsearch安装 : https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz

1 tar -xvf xx.tar.gz #解压软件包 
2
3 vim config/elasticsearch.yml #进入文件夹关掉xpack+允许内网访问 
4 xpack.security.enabled: false 
5 network.host: 0.0.0.0 
6
7 groupadd es #创建用户组 
8
9 useradd es -g es #创建用户 
10 
11 chown es:es '解压文件夹' #将解压出来的软件包所有人由root更换为es: 
12 
13 su es #登陆es用户 
14 
15 bin/elasticsearch -d #进入文件夹中使用启动命令 
16 
17 #返回root用户后使用curl localhost:9200 显示以为信息为成功: 
18 { 
19 "name": "localhost.localdomain", 
20 "cluster_name": "elasticsearch", 
21 "cluster_uuid": "cGvxPkPAQWGmDyRWAZhFXQ", 
22 "version": { 
23 "number": "8.1.2", 
24 "build_flavor": "default", 
25 "build_type": "tar", 
26 "build_hash": "31df9689e80bad366ac20176aa7f2371ea5eb4c1", 
27 "build_date": "2022-03-29T21:18:59.991429448Z", 
28 "build_snapshot": false, 
29 "lucene_version": "9.0.0", 
30 "minimum_wire_compatibility_version": "7.17.0", 
31 "minimum_index_compatibility_version": "7.0.0" 
32 }, 
33 "tagline": "You Know, for Search" 
34 }

常见问题:

1 could not find java in bundled JDK at /data/tool/elasticsearch-8.1.2/jdk/bin/java
2 以上问题是因为jdk版本太低,官方要求必须要jdk17以上
3 所以,去官上下载吧:https://jdk.java.net/17/ 
4
5
6 ERROR: [4] bootstrap checks failed. You must address the points described in the
following [4] lines before starting Elasticsearch. 
7
8 bootstrap check failure [1] of [4]: max file descriptors [4096] for elasticsearch
process is too low, increase to at least [65535] 
9
10 bootstrap check failure [2] of [4]: max number of threads [3764] for user [es] is too
low, increase to at least [4096]
11
12 #修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效,注意带* 号
13 * soft nofile 65536
14 * hard nofile 65536
15 * soft nproc 4096
16 * hard nproc 4096
17 #增加完需要重启linux
18 
19 bootstrap check failure [3] of [4]: max virtual memory areas vm.max_map_count [65530] is
 too low, increase to at least [262144]
20 #需要切到root下,执行以下命令
21 # echo "vm.max_map_count=262144" >> /etc/sysctl.conf
22 # sysctl -p #使修改立即生效
23
24 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,
cluster.initial_master_nodes] must be configured
25
26 #在elasticsearch.yml中加上如下配置:
27 discovery.seed_hosts: ["127.0.0.1", "192.168.60.128","dhc-elk"]
28 cluster.initial_master_nodes: ["es-node-1"]


kibana安装 : https://artifacts.elastic.co/downloads/kibana/kibana-8.1.2-linux-x86_64.tar.gz


1 官方网址:Download Kibana Free | Get Started Now | Elastic(下载与之匹配的版本):
https://www.elastic.co/cn/downloads/kibana
2
3 1.下载软件包并上传至安装目录
4
5 2.解压软件包并进入
6
7 3.修改配置文件
8
9 vim config/kibana.yml
10
11 server.port: 5601 //端口
12 server.host: "192.168.47.47" //安装的服务器的静态IP
13 elasticsearch.hosts: ["http://192.168.47.47:9200","http://192.168.47.47:9201","http://192.168.47.48:9200","ht
tp://192.168.47.49:9200"] //集群的地址
14 i18n.locale: "zh-CN" //中文界面
15
16 4.保存退出,启动es后才能成功启动kibana
17
18 bin/kibana --allow-root & //后台启动
19
20 5.防火墙开放其端口
21 firewall-cmd --zone=public --add-port=5601/tcp --permanent
22 firewall-cmd --reload
23 6.浏览器输出IP:5601进入kibana页面
24 http://192.168.60.128:5601/


很赞哦! (121)

文章评论

来说两句吧...

验证码: