How To Install Graylog in Centos7 | #2 Free Log Management And Visualization Course



#2 In this free series where i show you how to ship all system logs (pfsense in this example) to rsyslog, graylog and end up with beautiful graphs in grafana.

In this video i show you how to install graylog on CentOS 7. Next we will ship logs graylog, index them and create graphs in grafana.

***Subscribe to get notified when i upload new videos.

Here are the commands that you can copy and paste while following along:

Install java
#yum install java-1.8.0-openjdk-headless

Install policycoreutils-python

Install MongoDB. Follow these instructions:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

Install MongoDB

vi /etc/yum.repos.d/mongodb-org-4.0.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

yum install mongodb-org
systemctl start mongod
systemctl enable mongod

Install Elasticsearch

cat _ /etc/yum.repos.d/elasticsearc-6.repo __ EOL
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOL

rpm –import https://artifacts.elastic.co/GPG-KEY-elasticsearch
yum install elasticsearch

Configure elasticsearch
#Change Cluster name
vi /etc/elasticsearch/elasticsearch.yml

# ———————————- Cluster ———————————–
#
# Use a descriptive name for your cluster:
#
cluster.name: graylog
#

Restart and enable elasticsearch
sudo systemctl daemon-reload
systemctl restart elasticsearch
systemctl enable elasticsearch

Test elasticsearch
curl -X GET http://localhost:9200

Install Graylog
rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-3.0-repository_latest.rpm
yum install graylog-server

Setup Graylog
yum install epel-release
yum install pwgen
pwgen -N 1 -s 96 – #Password secret
echo -n “StrongPAssword” | sha256sum | cut -d” ” -f1 # Admin Password

Add password secret and admin hash in the configfile
#vi /etc/graylog/server/server.conf

password_secret =
root_password_sha2 =

Change these values
elasticsearch_shards = 1

# Default: 127.0.0.1:9000
#http_bind_address = 127.0.0.1:9000
http_bind_address = YourIP:9000

Open Firewall ports
firewall-cmd –add-port=9200/tcp –permanent
firewall-cmd –reload

Start and enable graylog:
systemctl start graylog-server
systemctl enable graylog-server

Access your graylog server at : http://_server-IP_:9000

In the next video, we will show you how to get logs in your graylog server and visualize them in grafana.

source
centos 7

Devin BARTON

Devin BARTON

I am an avid Linux lover and open source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mysteries.

14 thoughts on “How To Install Graylog in Centos7 | #2 Free Log Management And Visualization Course

Leave a Reply