In this tutorial, we will learn how to install Graylog 2.0 (latest version) and all it’s components on a CentOS 6.8 server.
Centralize and aggregate all your log files for 100% visibility. Use our powerful query language to search through terabytes of log data to discover and analyze important information.
Managing lots of servers and application would be a tedious task per se. Without a centralized log management and analysis software, logging in to each server to check/debug an error just to see walls of text adds to the burden. Worse, the important log messages are often being buried amidst the non-stop pouring of informational/debug log lines which makes it more difficult for an administrator or developer to efficiently do his job. This is where Graylog would be most helpful.
What is Graylog
Graylog is an open source log management and analysis solution that aggregates, stores and indexes log messages from one or multiple servers and/or applications.
Graylog uses these four components that work together to create a good logging experience
- Graylog Server itself
- Elasticsearch is used to store all the log messages
- MongoDB stores the Graylog configuration data
- Web Interface is a client-side single-page browser application for viewing and analyzing the logs
- Install Java 8
- Install MongoDB 3.2
- Install Elasticsearch 2.3
- Install Graylog 2.0
STEP 1: Install Java 8
One requirement for the Elasticsearch component is Java. At the time of writing, the latest Java is Version 8.
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/8u91-b14/jdk-8u91-linux-x64.rpm"
yum localinstall jdk-8u91-linux-x64.rpm
STEP 2: Install MongoDB 3.2
To install MongoDB using yum, we need to add it to our repository configuration. Create a new file
/etc/yum.repos.d/mongodb.repo and put the following inside it.
After adding the repository, proceed with the installation using yum and start it afterwards.
yum install -y mongodb-org
service mongod restart
chkconfig mongod on