码迷,mamicode.com
首页 > 其他好文 > 详细

elk(Elasticsearch 2.0.0, Logstash 2.0.0, Kibana4.2.0) redis centos6.6安装与配置

时间:2015-11-07 06:43:39      阅读:1103      评论:0      收藏:0      [点我收藏+]

标签:elasticsearch2.0.0 logstash 2.0.0 kibana4.2.0 redis elk

本次安装的相关环境:Centos_x64_6.6  redis2.8.23  Elasticsearch 2.0.0, Logstash 2.0.0,  Kibana4.2.0

软件下载地址:

redis: http://redis.io/download
Elasticsearch: wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.0.0/elasticsearch-2.0.0.rpm
Logstash: wget https://download.elastic.co/logstash/logstash/packages/centos/logstash-2.0.0-1.noarch.rpmKibana: wget  https://download.elastic.co/kibana/kibana/kibana-4.2.0-linux-x64.tar.gz
Kibana: wget https://download.elastic.co/kibana/kibana/kibana-4.2.0-linux-x64.tar.gz
jdk:  wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpmyum localinstall jdk-8u65-linux-x64.rpm

Install Java 8

[root@localhost src]# rpm -ivh jdk-8u65-linux-x64.rpm 
Preparing...                ########################################### [100%]
   1:jdk1.8.0_65            ########################################### [100%]
Unpacking JAR files...
        tools.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...
        jfxrt.jar...
[root@localhost src]# ln -s  /usr/java/jdk1.8.0_65/jre/bin/java /usr/bin/java

Install redis2.8

先安装依赖tcl
[root@localhost src]# yum install tcl

安装redis
[root@localhost src]#tar zxvf redis-2.8.23.tar.gz 
[root@localhost src]# cd redis-2.8.23
[root@localhost redis-2.8.23]#
[root@localhost redis-2.8.23]# make
[root@localhost redis-2.8.23]# make install

redis安装后配置
[root@localhost redis-2.8.23]# cd utils/
[root@localhost utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] 
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] 
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] 
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] 
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server] 
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!

Install Elasticsearch

[root@localhost src]#rpm -ivh elasticsearch-2.0.0.rpm
warning: elasticsearch-2.0.0.rpm: Header V4 RSA/SHA1 Signature, key ID d88e42b4: NOKEY
Preparing...                ########################################### [100%]
Creating elasticsearch group... OK
Creating elasticsearch user... OK
   1:elasticsearch          ########################################### [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using chkconfig
 sudo chkconfig --add elasticsearch
### You can start elasticsearch service by executing
 sudo service elasticsearch start

 [root@localhost src]# /etc/init.d/elasticsearch start
  正在启动 elasticsearch:                                   [确定]
 [root@localhost src]# chkconfig elasticsearch on

Install Kibana

[root@localhost opt]#groupadd -g 1005 kibana[root@localhost opt]#useradd -u 1005 -g 1005 kibana
[root@localhost opt]# tar zxvf kibana-4.2.0-linux-x64.tar.gz  -C /opt/
[root@localhost ~]# cd /opt[root@localhost opt]# mv kibana-4.2.0-linux-x64/ kibana
[root@localhost opt]#chown -R kibana: /opt/kibana
[root@localhost opt]#cd /etc/init.d &&  curl -o kibana https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/fc5025c3fc499ad8262aff34ba7fde8c87ead7c0/kibana-4.x-init
[root@localhost opt]#cd /etc/init.d &&  curl -o kibana https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/fc5025c3fc499ad8262aff34ba7fde8c87ead7c0/kibana-4.x-initcd /etc/default &&  curl -o kibana https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/fc5025c3fc499ad8262aff34ba7fde8c87ead7c0/kibana-4.x-default
[root@localhost opt]#service kibana start
[root@localhost opt]#chkconfig kibana on

Install Logstash

[root@localhost src]rpm -ivh logstash-2.0.0-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:logstash               ########################################### [100%]
相当于客户端配置   
 [root@localhost conf.d]# cat /etc/logstash/conf.d/agent.conf
input {
        file {
                type => "nginx_access"
                path => ["/usr/share/nginx/logs/test.access.log"]
        }
}
output {
        redis {
                host => "localhost"
                data_type => "list"
                key => "logstash:redis"
        }
}
相当于服务端配置
[root@localhost conf.d]# cat /etc/logstash/conf.d/index.conf 
input {
        redis {
                host => "localhost"
                data_type => "list"
                port => 6379
                key => "logstash:redis"
                type => "redis-input"
        }
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
}
[root@localhost src]# /etc/init.d/logstash start
[root@localhost src]# chkconfig logstash on


本文出自 “linux技术分享” 博客,请务必保留此出处http://guomt.blog.51cto.com/150883/1710500

elk(Elasticsearch 2.0.0, Logstash 2.0.0, Kibana4.2.0) redis centos6.6安装与配置

标签:elasticsearch2.0.0 logstash 2.0.0 kibana4.2.0 redis elk

原文地址:http://guomt.blog.51cto.com/150883/1710500

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!