Linux下Elasticsearch+Kibana安装部署

ES安装包下载官方链接:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz

kibana安装包下载官方链接:

https://artifacts.elastic.co/downloads/kibana/kibana-6.6.2-linux-x86_64.tar.gz

二者需要安装相同的版本

1、ES安装步骤

1、 初始化安装目录

[root@zhulin es]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@zhulin es]# mkdir -p /export/servers
[root@zhulin es]# mkdir -p /usr/local/elasticsearch/data
[root@zhulin es]# mkdir -p /usr/local/elasticsearch/logs
[root@zhulin es]# tar zxvf elasticsearch-6.6.2.tar.gz -C /export/servers/
[root@zhulin es]# cd /export/servers/
[root@zhulin servers]# mv elasticsearch-6.6.2 elasticsearch

2、修改配置文件:

涉及字段:cluster.name、node.name、path.data、path.logs、network.host、http.port

vim elasticsearch/config/elasticsearch.yml 

# Use a descriptive name for your cluster:
cluster.name: my-application
#
# Use a descriptive name for the node:
node.name: node-1
#
# Path to directory where to store the data (separate multiple locations by comma):
path.data: /usr/local/elasticsearch/data
#
# Path to log files:
path.logs: /usr/local/elasticsearch/logs
#
# Set the bind address to a specific IP (IPv4 or IPv6):
network.host: 192.168.0.161
#
# Set a custom port for HTTP:
http.port: 9200

3、 运行遇到的问题

3.1、系统未安装JDK 

[root@zhulin servers]# ./elasticsearch/bin/elasticsearch
which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
could not find java; set JAVA_HOME or ensure java is in PATH

修复:安装JDK1.8版本

[root@zhulin servers]# yum search java|grep jdk
[root@zhulin servers]# yum install java-1.8.0-openjdk
[root@zhulin servers]# java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

3.2、不能使用root权限

[root@zhulin servers]# ./elasticsearch/bin/elasticsearch
[2021-06-11T16:23:31,584][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] \
[node-1] uncaught exception in thread [main] \
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: \
can not run elasticsearch as root
...

修复:创建并使用普通用户权限运行ES

[root@zhulin servers]# useradd es
[root@zhulin servers]# passwd es
[root@zhulin servers]# chown -R es:es /export/servers/elasticsearch
[root@zhulin servers]# chown -R es:es /usr/local/elasticsearch
[root@zhulin servers]# su es
[es@zhulin servers]$

ES运行成功后,开放两服务个端口:

9200 是ES节点与外部通讯使用的端口。(是http协议的restful接口)
9300是ES节点之间通讯使用的端口。(是集群间tcp通讯端口)

[es@zhulin servers]$ nohup ./elasticsearch/bin/elasticsearch &
[root@zhulin ~]# netstat -ntlp | grep java
tcp6       0      0 192.168.0.161:9200          :::*       LISTEN      7964/java
tcp6       0      0 192.168.0.161:9300          :::*       LISTEN      7964/java

 备注:

     CentOS6.X系统上运行出现的问题(SecComp及max_map_count) 

     问题修复参考:  https://www.cnblogs.com/socketqiang/p/11363024.html

2、kibana安装步骤

[root@zhulin es]# tar zxvf kibana-6.6.2-linux-x86_64.tar.gz -C /run/
[root@zhulin es]# cd /run/kibana-6.6.2-linux-x86_64/

修改配置文件:config/kibana.yml

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 80

# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.0.161"

# new add 
elasticsearch.url: "http://192.168.0.161:9200"

直接后台运行Kibana(没有问题)

[root@zhulin kibana-6.6.2-linux-x86_64]# nohup bin/kibana &
[root@zhulin kibana-6.6.2-linux-x86_64]# netstat -ntlp | grep node
tcp   0   0 192.168.0.161:80    0.0.0.0:*     LISTEN     8196/bin/../node/bi

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值