Graylog is an open-source log collector, with the storage behind it paired with MongoDB, while the search engine is provided by Elasticsearch . The previous version of the main two parts of the collection into the server and the Web interface, the web search for most of the tutorial, and the installation process seems to be very complex, the new version of the Graylog Two parts have been combined, the installation process is very simple, and convenient for cluster deployment and maintenance. The following is the installation process, the system is CentOS.
??
#yum-y Install java-1.8.0-openjdk-headless.x86_64
??
=============disable SELinux and firewall=============
??
#systemctl Stop Firewalld.service
#systemctl Disable Firewalld.service
??
# Sestatus
SELinux status:enabled
SELINUXFS Mount:/sys/fs/selinux
SELinux root directory:/etc/selinux
Loaded Policy name:targeted
Current mode:enforcing
Mode from config file:disabled
Policy MLS status:enabled
Policy Deny_unknown status:allowed
Max Kernel Policy version:28
??
??
#setenforce 0
#vim/etc/sysconfig/selinux
Selinux=disable
??
??
========================================= Install mongodb===================
# Vi/etc/yum.repos.d/mongodb-org-3.2.repo
[mongodb-org-3.2]
Name=mongodb Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
Gpgcheck=1
Enabled=1
Gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
??
??
# yum-y Install mongodb-org
#sudo chkconfig--add Mongod
#sudo Systemctl Daemon-reload
#sudo Systemctl Enable Mongod.service
#sudo systemctl Start Mongod.service
??
===================================install Elasticsearch ===========================================
??
# rpm--import https://packages.elastic.co/GPG-KEY-elasticsearch
??
# Vi/etc/yum.repos.d/elasticsearch.repo
[elasticsearch-2.x]
Name=elasticsearch repository for 2.x packages
Baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
Gpgcheck=1
Gpgkey=https://packages.elastic.co/gpg-key-elasticsearch
Enabled=1
??
# yum-y Install Elasticsearch
??
??
# VI/ETC/ELASTICSEARCH/ELASTICSEARCH.YML
Cluster.name:graylog2
??
#chkconfig--add Elasticsearch
#systemctl Daemon-reload
#systemctl Enable Elasticsearch.service
#systemctl Restart Elasticsearch.service
??
# curl-x GET http://localhost:9200
??
{
"Status": 200,
"Name": "Silver Fox",
"Cluster_Name": "Graylog2"
},
"Tagline": "Know, for Search"
}
??
========================================== Install GRAYLOG2 =============================
#rpm-UVH https://packages.graylog2.org/repo/packages/graylog-2.0-repository_latest.rpm
#yum Install Graylog-server
??
# vi/etc/graylog/server/server.conf
Password_secret = 0b4e7a0e5fe84ad35fb5f95b9ceeac790b4e7a0e5fe84ad35fb5f95b9ceeac79//123456
ROOT_PASSWORD_SHA2 =ed02457b5c41d964dbd2f2a609d63fe1bb7528dbe55e1abf5b52c249cd735797//AAAAAA
??
Web_listen_uri = http://0.0.0.0:9000/
Rest_listen_uri = http://0.0.0.0:12900/
Rest_transport_uri = http://192.168.1.135:12900/
Elasticsearch_shards = 1
Elasticsearch_replicas = 0
Mongodb_useauth = False
#sudo chkconfig--add Graylog-server
#systemctl Daemon-reload
#systemctl Enable Graylog-server.service
#systemctl Start Graylog-server.service
??
??
========================================test==================================================
[Email protected] test]# NETSTAT-NLTP
Active Internet connections (only servers)
Proto recv-q send-q Local address Foreign address State Pid/program Name
TCP 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 2246/mongod
TCP 0 0 0.0.0.0:28010 0.0.0.0:* LISTEN 7595/./mongod
TCP 0 0 0.0.0.0:28011 0.0.0.0:* LISTEN 9352/./mongod
TCP 0 0 0.0.0.0:28012 0.0.0.0:* LISTEN 9443/./mongod
TCP 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2348/dnsmasq
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 993/sshd
TCP 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 982/cupsd
TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2192/master
TCP6 0 0::: 9000:::* LISTEN 1010/java
TCP6 0 0::: 1514:::* LISTEN 1010/java
TCP6 0 0::: 12202:::* LISTEN 1010/java
TCP6 0 0::: 22222:::* LISTEN 1010/java
TCP6 0 0 127.0.0.1:9200:::* LISTEN 1013/java
TCP6 0 0:: 1:9200:::* LISTEN 1013/java
TCP6 0 0 127.0.0.1:9300:::* LISTEN 1013/java
TCP6 0 0:: 1:9300:::* LISTEN 1013/java
TCP6 0 0::: $:::* LISTEN 993/sshd
TCP6 0 0:: 1:631:::* LISTEN 982/CUPSD
TCP6 0 0:: 1:25:::* LISTEN 2192/master
TCP6 0 0::: 12900:::* LISTEN 1010/java
TCP6 0 0 127.0.0.1:9350:::* LISTEN 1010/java
TCP6 0 0:: 1:9350:::* LISTEN 1010/java
TCP6 0 0::: 11111:::* LISTEN 1010/java
[Email protected] test]#
??
New GRAYLOG2 installation process