`
taiwei.peng
  • 浏览: 228144 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ELK搭建笔记

    博客分类:
  • java
阅读更多

一. 安装elasticsearch

 

1.yum安装wget

yum -y install wget

 

2.下载安装 Elasticsearch

 

tar -zxvf elasticsearch-6.5.0.tar.gz

 

cd /usr/local/elasticsearch-6.5.0/bin

 

挂在后台,离开窗口不会停掉

./elasticsearch &

 

ps aux |grep elasticsearch

 

can not run elasticsearch as root

 

useradd es

 

passwd es

密码是dzkj123

 

 

 

chown -R es:es /usr/local/elasticsearch-6.5.0

ch

 

chown -R es:es /usr/local/to/data

 

 

chown -R es:es /usr/local/to/logs

 

遇到一堆问题参考资料地址

https://blog.csdn.net/weixin_41615494/article/details/79591335

这个博客里面写的很详细,跟我遇到的问题是一样的

 

ps aux |grep elasticsearch

 

netstat -lntp |grep 9200

 

二.安装kibana

tar -zxvf kibana-6.5.0-linux-x86_64.tar.gz

 

cd /usr/local/kibana-6.5.0-linux-x86_64/bin

 

./kibana &

 

ps aux |grep kibana

 

netstat -lntp |grep 5601

 

另外一种安装方法

yum -y install kibana

或者

wget https://artifacts.elastic.co/downloads/kibana/kibana-6.0.0-x86_64.rpm

安装

rpm -ivh kibana-6.0.0-x86_64.rpm

卸载

rpm -e --nodeps kibana

启动

service kibana start

 

三.安装logstash

tar -zxvf logstash-6.5.0.tar.gz

 

cd /usr/local/logstash-6.5.0/bin

 

./logstash &

 

测试

logstash -e 'input { stdin { } } output { stdout {} }'

 

ps aux |grep logstash

 

另外的启动方式

logstash -f /usr/local/logstash-6.5.0/config/test.conf -w 4 &

 

四.elasticsearch head 的安装

1.下载elasticsearch-head并解压

在线下载

wget  https://github.com/mobz/elasticsearch-head/archive/master.zip

 

解压zip文件

unzip  master.zip

 

2.安装node

wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz

 

tar -zxvf node-v4.4.7-linux-x64.tar.gz

解压完node的安装文件后,需要配置下环境变量,编辑/etc/profile

export NODE_HOME=/usr/local/node-v4.4.7-linux-x64

export PATH=$JAVA_HOME/bin:$NODE_HOME/bin:$PATH

 

source /etc/profile

 

这个时候可以测试一下node是否生效:

node -v

npm -v

 

3.安装grunt

cd /usr/local/elasticsearch-head-master

 

npm install -g grunt-cli  

 

npm install

 

//执行后会生成node_modules文件夹

 

修改Gruntfile.js

增加hostname属性,设置为*

 

cd /usr/local/elasticsearch-head-master/_site

vi app.js

 

把localhost修改成你es的服务器地址

 

5.运行head 启动nodejs

cd /usr/local/elasticsearch-head-master

grunt server &

 

权限设置

vim /usr/local/elasticsearch/elasticsearch.yml

 

http.cors.enabled: true

http.cors.allow-origin: "*"

 

curl -XPUT '10.10.11.70:9100/book'

 

浏览器访问 http://10.10.11.70:9100

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics