这里写目录标题
ElasticSearch 安装
1、下载
地址:https://www.elastic.co/cn/downloads/elasticsearch

$> wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.1-linux-x86_64.tar.gz
2、解压
$> tar -zxvf elasticsearch-7.12.1-linux-x86_64.tar.gz

3、JDK1.8 安装(…)
4、创建系统用户
elasticsearch不能以root权限来运行,会出现这种错误:Exception in thread “main” java.lang.RuntimeException: don’t run elasticsearch as root。
因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户解决办法:
(1)创建用户 root$> adduser nn (2)设置密码(连续输入两遍) root$> passwd (3)root 用户给新增的用户添加权限(root 用户创建的文件其他用户是无权操作的) root$> chown -R nn /你的elasticsearch安装目录
5、启动ES(切换为普通用户启动)
# 切换用户 root$> su nn # 启动ES nn$> ./bin/elasticsearch

5、配置远程访问
修改 elasticsearch.yml
nn$>vim elasticsearch-7.12.1/config/elasticsearch.yml # 加入以下配置 network.bind_host: 0.0.0.0 network.publish_host: elasticsearch所在的主机的ip http.port: 9200
6、启动异常1
然后修改文件 /etc/sysctl.conf ,添加下面这个配置
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least []
vm.max_map_count =
6.1、更新配置
root$> sysctl -p
8 、启动异常1
of [2]: max file descriptors [4096] for elasticsearch process is too low, in
解决:切换到root 用户
root$> vi /etc/security/limits.conf //在文件末尾添加下面的参数值 * soft nofile 65536 * hard nofile
9 、启动异常2
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
解决:修改elasticsearch.yml
$> vim elasticsearch-7.12.1/config/elasticsearch.yml # 加入以下配置 cluster.initial_master_nodes: ["node-1", "node-2"]
10、启动成功

10 、关闭防火墙
# 检查防火墙是否开启 root$> systemctl status firewalld # 关闭防火墙 root$> systemctl stop firewalld


Kibana 安装
1、下载
Linux 下载:
root$ > wget https://artifacts.elastic.co/downloads/kibana/kibana-7.12.1-linux-x86_64.tar.gz
Linux 解压:
root$ > tar -zxvf kibana-7.12.1-linux-x86_64.tar.gz
2、为普通用户添加权限
root$> chown -R nn ./kibana-7.12.1-linux-x86_64
3、配置远程访问
3.1 切换为 普通用户(nn)
root$> su nn
3.2 修改配置文件
nn$> vim kibana-7.12.1-linux-x86_64/config/kibana.yml server.port: 5601 server.host: "0.0.0.0" elasticsearch.hosts: ["http://localhost:9200"] # 配置 ES 连接地址

4、启动服务
nn$> ./kibana-7.12.1-linux-x86_64/bin/kibana
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/199682.html原文链接:https://javaforall.net
