ELK测试环境搭建


环境介绍,
单节点安装ELK
系统介绍:
centos7.4  4C8G
ELK版本5.6.9
##############
安装部署,
1、首先安装JDK,本文采用的是jdk1.8
上传软件包到系统/opt目录下,在/目录下创建soft文件夹
mkdir /soft
解压JDK软件包,
tar -zxvf jdk1.8.tar.gz -C /soft
配置环境变量,
vim /etc/profile
在文件末尾添加
export JAVA_HOME=/soft/java(java文件的路径)
export PATH=$PATH:$JAVA_HOME/bin
退出编辑文件,执行source /etc/profile立即生效
#####################################################
安装elasticsearch
解压软件包,并且移动解压后的软件包到soft目录下,
unzip elasticsearch
修改配置文件
vim /soft/elasticsear/conf/elasticsearch.yml
cluster.name: poc
node.name: poc
network.host: es主机IP地址
开启跨越,如果不开启的话head无法使用
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["poc"](如果是多台主机,使用、隔开)
discovery.zen.ping.timeout: 120s
bootstrap.system_call_filter: false
discovery.zen.minimum_master_nodes: 1
gateway.recover_after_nodes: 1
#####################################################
更改主机配置文件,
vim /etc/sysctl.conf
vm.swapiness = 0
vm.max_map_count=2621444
退出执行sysctl -p生效
更改主机配置文件,
vim  /etc/security/limits.conf
*    soft    nofile 65536
*    hard    nofile    131072
*    soft    nproc    2048
*    hard    nproc    4096
保存退出
#######################################################
elasticsearch无法使用root用户启动,需要创建其他用户
useradd es
赋予elasticsearch解压后文件夹es的属主权限
chown -R es elasticsearch
启动elasticsearch
su - es
bin/elasticsearch -d(后台启动)
#########################################################
安装elasticsearch-head插件
从elasticsearch5版本以后head被node.js收购,单独成立一个项目所以bin/plugin命令无法使用
安装node.js
xz -d node-v8.1.1-linuxx64.tar.xz
tar -xvf node-v8.1.1-linuxx64.tar.xz
添加环境变量,修改配置文件/etc/profile
vim /etc/profile
export NODE_HOME=/home/tools/node-v8.1.1-linuxx64
export PATH=$PATH:$NODE_HOME/bin
执行以下命令环境变量生效
source /etc/profile
验证node.js是否安装成功
node -v
npm -v
#######################################################3
下载head
git clone
git://github.com/mobz/elasticsearch-head.git
安装依赖软件包,必须进入elasticsearch-head目录,需要一些时间
npm install
npm install -g cnpm --registry= https://registry.npm.taobao.org
修改配置文件vim Gruntfile.js
hostname:  '0.0.0.0'
启动ground
1.cd elasticsearchhead/node_modules/grunt/bin/
./grunt server
或者进入elasticsearch-head目录后,配置完Gruntfile.js 直接 npm run start 即可
##############################################################################
后台启动命令
nohup /home/tools/elasticsearch-head/node_modules/grunt/bin/grunt server &
页面中locahost需要换成es的地址
#########################################################################
logstasch安装解压logstash软件包
进入logstash/conf目录下,
创建.conf文件 例vim logstash-simple.conf
添加一下内容
input { stdin { } }
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }}

完成退出,启动logstash
bin/logstash -f conf/logstash-simple.conf

此配置是交互式操作,输入hello word就会直接采集到elasticsearch中,
################################################################
kibana安装
解压kibana软件包,修改配置文件config/kibana.yml
server.port: 5601
server.host: "192.168.100.233" (kibana主机)
elasticsearch_url: "http://192.168.100.233:9200"(IP地址是elasticsearch地址)
后台启动
nohup bin/kibana &
访问地址:
http://kibana地址:5601



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值