ES 6.x 和 kibana 6.x 安装配置

1、ElasticSearch 6.x 安装

1.1、解压

# 上传并解压
tar -zxvf elasticsearch-6.4.0-linux-x86_64.tar.gz

1.2、修改权限信息

避免其他用户无法访问,添加权限:

chmod -R 777 elasticsearch-6.4.0

之后直接启动会报错,如下:

(py27) [root@master elasticsearch-6.4.0]# ./bin/elasticsearch
[2019-06-19T11:10:12,312][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler]ain]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.ja.4.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAh-6.4.0.jar:6.4.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.javr:6.4.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearc
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.:6.4.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[e
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:0]
	... 6 more

报错原因:不能用 root 用户启动。
在这里插入图片描述

1.3、配置

  1. 增加用户
# 增加用户
useradd -d /home/henry -m henry
# 设置密码
passwd henry
  1. 使用root用户修改配置文件
# 修改limits.conf 添加如下内容
vim /etc/security/limits.conf

* soft memlock unlimited
* hard memlock unlimited
* 
* soft nofile 65536
* hard nofile 131072

# 修改90-nproc.conf 配置文件
# CentOS 6.x 需要修改
# CentOS 7.x 对应的是 20-nproc.conf ,不需要修改
vim /etc/security/limits.d/90-nproc.conf

# 把soft nproc 1024
# 修改为:
soft nproc 4096

# 修改配置文件sysctl.conf 添加下面配置
vim /etc/sysctl.conf
vm.max_map_count=655360
# 并执行命令生效
sysctl -p

# 在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面
vim config/elasticsearch.yml
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

# 修改elasticsearch.yml中的hosts配置
network.host: 0.0.0.0 #所有所有ip可以访问
  1. 切换用户
su henry
  1. 启动
# 前台启动
./bin/elasticsearch

# 后台启动
./bin/elasticsearch -d
  1. 访问验证
http://master:9200
  • 前台启动页面访问:
    在这里插入图片描述
  • 后台启动页面访问:
    在这里插入图片描述

2、kibana 6.x 安装

2.1、解压

# 上传并解压
tar -zxvf kibana-6.4.0-linux-x86_64.tar.gz

2.2、配置

  1. 修改配置文件
vim config/kibana.yml

server.host: "master"
elasticsearch.url: "http://master:9200"
  1. 启动 kibana
# 前台启动
./bin/kibana

# 后台启动
nohup ./bin/kibana >/dev/null 2>&1 &
注意:后台启动之后,想停止的话需要使用这个命令查找对应的进程信息
ps -ef | grep node 
#或者 
netstat -anltp | grep 5601
  1. 访问验证
    在这里插入图片描述

2.3、Kibana 添加可视化图形

  • 饼图、柱状图:
    在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值