centOS7 安装es+kibana
程序员文章站
2024-01-15 19:51:46
...
下载elasticsearch7.9.3:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-linux-x86_64.tar.gz
https://www.elastic.co/cn/downloads/elasticsearch
下载kibana7.9.3:https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-linux-x86_64.tar.gz
https://www.elastic.co/cn/downloads/kibana
一、安装Java环境
#安装Java8 环境
#csdn下载地址:https://download.csdn.net/download/xiaoxionglove/12918522
#存放到目录 /application/jdk-8u211-linux-x64.tar.gz
tar -zxvf jdk-8u211-linux-x64.tar.gz
yum install nano
sudo nano /etc/profile
在最末尾添加如下配置:
#set Java environment
export JAVA_HOME=/application/jdk1.8.0_211
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
#执行命令使修改立即生效
source /etc/profile
#测试安装是否成功
java -version
#建立软连接:
ln -s /application/jdk1.8.0_211/bin/java /usr/bin/java
二、将elasticsearch-7.9.3-linux-x86_64.tar.gz和kibana-7.9.3-linux-x86_64.tar.gz 拷贝到服务器目录: /application
elasticsearch安装:
tar -zxvf elasticsearch-7.9.3-linux-x86_64.tar.gz
mv elasticsearch-7.9.3 /usr/local/
cd /usr/local/elasticsearch-7.9.3
mkdir data
nano /usr/local/elasticsearch-7.9.3/config/elasticsearch.yml
修改如下:
cluster.name: xpc-elasticsearch
node.name: es-node0
path.data: /usr/local/elasticsearch-7.9.3/data
path.logs: /usr/local/elasticsearch-7.9.3/logs
network.host: 0.0.0.0
cluster.initial_master_nodes: ["es-node0"]
nano /etc/security/limits.conf #由于我是虚拟机,内存不够,所以配置小点才能启动,增加下面内容
末尾添加如下:
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096
nano /etc/sysctl.conf #由于我是虚拟机,内存不够,所以配置小点才能启动
修改内空末尾添加一段:vm.max_map_count=262145
sysctl -p #刷新一下
#ES不允许使用root操作es,需要添加用户,操作如下
useradd esuser
chown -R esuser:esuser /usr/local/elasticsearch-7.9.3
su esuser #切换到esuser用户
##切换到esuser用户,启动es
cd /usr/local/elasticsearch-7.9.3/bin
./elasticsearch
#允许防火墙端口
firewall-cmd --zone=public --add-port=9200/tcp --permanent
firewall-cmd --reload
浏览器输入:http://192.168.1.101:9200
kibana安装
tar -zxvf kibana-7.9.3-linux-x86_64.tar.gz
mv kibana-7.9.3-linux-x86_64 /usr/local/
cd /usr/local/kibana-7.9.3-linux-x86_64
chown -R esuser:esuser /usr/local/kibana-7.9.3-linux-x86_64
cd /usr/local/kibana-7.9.3-linux-x86_64/config
nano kibana.yml #修改如下:
server.port: 5601
server.host: "192.168.1.101"
elasticsearch.hosts: ["http://192.168.1.101:9200"]
#启动:
su esuser #切换到esuser用户
cd /usr/local/kibana-7.9.3-linux-x86_64/bin
./kibana
#允许防火墙端口
firewall-cmd --zone=public --add-port=5601/tcp --permanent
firewall-cmd --reload
浏览器输入:http://192.168.1.101:5601
运行效果:
上一篇: CentOS7安装配置Kibana
下一篇: CentOS7 安装 Kibana