Last active
October 23, 2015 06:27
-
-
Save dynax60/1894e1a06bb4c2fe42fc to your computer and use it in GitHub Desktop.
Установка ELK на CentOS 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Java | |
| ==== | |
| cd /opt | |
| wget -O jre-8u65-linux-i586.tar.gz --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/jre-8u65-linux-i586.tar.gz" | |
| tar xvf jre-8*.tar.gz | |
| rm -f /opt/jre-8*.tar.gz | |
| alternatives --install /usr/bin/java java /opt/jre1.8*/bin/java 1 | |
| alternatives --config java | |
| Elastics | |
| ======== | |
| rpm --import https://packages.elasticsearch.org/GPG-KEY-elasticsearch | |
| vim /etc/yum.repos.d/elasticsearch.repo | |
| Config: | |
| [elasticsearch-1.7] | |
| name=Elasticsearch repository for 1.7.x packages | |
| baseurl=http://packages.elastic.co/elasticsearch/1.7/centos | |
| gpgcheck=1 | |
| gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch | |
| enabled=1 | |
| yum -y install elasticsearch | |
| chkconfig --add elasticsearch | |
| chkconfig elasticsearch on | |
| vim /etc/elasticsearch/elasticsearch.yml | |
| Config: | |
| path.data: /data/elasticsearch/data | |
| path.work: /data/elasticserach/tmp | |
| mkdir -p /data/elasticsearch/tmp | |
| chown -R elasticsearch.elasticsearch /data/elasticsearch | |
| chkconfig elasticsearch on | |
| service elasticsearch start | |
| Сервер доступен по адресу: http://localhost:9200 | |
| Для Elastics есть интересный плюгин Google Chrome для запросов: Sense (Beta). | |
| Logstash | |
| ======= | |
| rpm --import https://packages.elasticsearch.org/GPG-KEY-elasticsearch | |
| vim /etc/yum.repos.d/logstash.repo | |
| Config: | |
| [logstash-1.5] | |
| name=Logstash repository for 1.5.x packages | |
| baseurl=http://packages.elasticsearch.org/logstash/1.5/centos | |
| gpgcheck=1 | |
| gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch | |
| enabled=1 | |
| yum -y install logstash | |
| Конфигурацию создавать тут: /etc/logstash/conf.d/ | |
| Kibana | |
| ====== | |
| cd /opt | |
| curl -O https://download.elastic.co/kibana/kibana/kibana-4.1.2-linux-x86.tar.gz | |
| tar xzf kibana-4.1.2-linux-x86.tar.gz | |
| ln -s kibana-4.1.2-linux-x86 kibana4 | |
| cd kibana4 | |
| vim config/kibana.yml | |
| Config: | |
| host: "localhost" | |
| elasticsearch_url: "http://localhost:9200" | |
| wget https://raw.githubusercontent.com/cjcotton/init-kibana/master/kibana | |
| vim kibana | |
| Config: | |
| KIBANA_BIN=/opt/kibana4/bin | |
| DAEMON_USER=kibana | |
| mv kibana /etc/init.d/ && chmod +x /etc/init.d/kibana | |
| groupadd kibana | |
| useradd -b /opt/kibana4 -g kibana -s /sbin/nologin kibana | |
| chown -R kibana.kibana /opt/kibana4/ | |
| chkconfig --add kibana && chkconfig kibana on | |
| service kibana start | |
| Nginx | |
| ===== | |
| vim /etc/yum.repos.d/nginx.repo | |
| Config: | |
| [nginx] | |
| name=nginx repo | |
| baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ | |
| gpgcheck=0 | |
| enabled=1 | |
| yum -y install nginx httpd-tools | |
| htpasswd -c /etc/nginx/htpasswd.users admin | |
| vim /etc/nginx/conf.d/kibana.conf | |
| Config: | |
| server { | |
| listen 80; | |
| server_name root.local; | |
| auth_basic "Restricted Access"; | |
| auth_basic_user_file /etc/nginx/htpasswd.users; | |
| location / { | |
| proxy_pass http://localhost:5601; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_set_header Host $host; | |
| proxy_cache_bypass $http_upgrade; | |
| } | |
| } | |
| chkconfig --add nginx | |
| chkconfig nginx on | |
| service nginx start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment