本次安装的相关环境: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
[[email protected] 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... [[email protected] src]# ln -s /usr/java/jdk1.8.0_65/jre/bin/java /usr/bin/java
Install redis2.8
先安装依赖tcl [[email protected] src]# yum install tcl 安装redis [[email protected] src]#tar zxvf redis-2.8.23.tar.gz [[email protected] src]# cd redis-2.8.23 [[email protected] redis-2.8.23]# [[email protected] redis-2.8.23]# make [[email protected] redis-2.8.23]# make install redis安装后配置
[[email protected] redis-2.8.23]# cd utils/ [[email protected] 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
[[email protected] 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 [[email protected] src]# /etc/init.d/elasticsearch start 正在启动 elasticsearch: [确定] [[email protected] src]# chkconfig elasticsearch on
Install Kibana
[[email protected] opt]#groupadd -g 1005 kibana[[email protected] opt]#useradd -u 1005 -g 1005 kibana [[email protected] opt]# tar zxvf kibana-4.2.0-linux-x64.tar.gz -C /opt/ [[email protected] ~]# cd /opt[[email protected] opt]# mv kibana-4.2.0-linux-x64/ kibana [[email protected] opt]#chown -R kibana: /opt/kibana [[email protected] opt]#cd /etc/init.d && curl -o kibana https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/fc5025c3fc499ad8262aff34ba7fde8c87ead7c0/kibana-4.x-init [[email protected] 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 [[email protected] opt]#service kibana start [[email protected] opt]#chkconfig kibana on
Install Logstash
[[email protected] src]rpm -ivh logstash-2.0.0-1.noarch.rpm Preparing... ########################################### [100%] 1:logstash ########################################### [100%] 相当于客户端配置 [[email protected] 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" } } 相当于服务端配置 [[email protected] 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"] } }
[[email protected] src]# /etc/init.d/logstash start
[[email protected] src]# chkconfig logstash on
时间: 2024-10-13 10:45:25