• 0 342 317 1951

Centos 8 üzerinde Graylog kurulumu.

yum check-update
yum update -y kernel
yum update
reboot

sudo yum install java-1.8.0-openjdk
yum install epel-release
sudo yum install pwgen
sudo yum install vim
sudo yum install nano


nano /etc/yum.repos.d/mongodb-org.repo  içine şu alt satırları ekle.Kaydet çık.

[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/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


rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
nano /etc/yum.repos.d/elasticsearch.repo içine şu alt satırları ekle.Kaydet çık.

[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/oss-6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

yum install elasticsearch-oss

nano /etc/elasticsearch/elasticsearch.yml

nano /etc/elasticsearch/jvm.options

getenforce -> permissive

nano /etc/sysconfig/selinux  kalıcı kapatmak için bunu yap
 
#SELINUX=enforcing celal
SELINUX=disabled

ls -lZ

systemctl start mongod
systemctl enable mongod
systemctl status mongod


rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-3.1-repository_latest.rpm
yum list graylog-server
yum clean all

nano /etc/graylog/server/server.conf ta şunları yap
#http_bind_address = 127.0.0.1:9000  celal
http_bind_address = 0.0.0.0:9000

data_dir = /var/lib/graylog-server

pwgen -N 1 -s 96   ile komut satırında şifre üret server.conf a aşağıdaki gibi password_secret karşısına yaz.
password_secret = IoNtTzMDDcxPR1jnwGvGNYamlNHuHK09sgLr7Xn3cxV9taUssCDExg2BLVHO0ez6uakLsL0mNvkD7yjVRYUh3Zv3WKHIe9Lr

#root_timezone = UTC celal
root_timezone = Europe/Istanbul

root_username = admin   # i kaldır ve aktif et

Şu komutla şifre üret oluşan şifreyi root_password_sha2 karşısına yaz server.conf dosyasinda
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
Enter Password: okyanus1
7036117834bb123fe6f13b6a1444c40c2827a5697f4504e60407006941b622db


root_password_sha2 = 7036117834bb123fe6f13b6a1444c40c2827a5697f4504e60407006941b622db


Elasticsearh u kalıcı başlatma adımları
systemctl daemon-reload
systemctl enable elasticsearch.service  deyince alt mesajları bastı.

Synchronizing state of elasticsearch.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service › /usr/lib/systemd/system/elasticsearch.service.

systemctl restart elasticsearch.service
systemctl status elasticsearch.service


 Şimdi firewall da gerekli olan port izinleri kalıcı şekilde verip reload edelim.
 firewall-cmd --permanent --add-port=9000/tcp

  firewall-cmd --reload

  firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens18
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 9000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:


graylog u kalıcı başlatma adımları
systemctl daemon-reload

systemctl enable graylog-server.service
Synchronizing state of graylog-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable graylog-server
Created symlink /etc/systemd/system/multi-user.target.wants/graylog-server.service › /usr/lib/systemd/system/graylog-server.service.

systemctl start graylog-server.service

 

http://172.27.27.27:9000/  ile kullanabilirsin. Ayar dosyasında verdiğin kullanıcı ve şifre ile gir.

 firewall-cmd --permanent --add-port=1514/udp

  firewall-cmd --reload


/etc/rsyslog.conf ta  şu alt satırı ekle sysloga gelen herşeyi verdiğin ip ve porta gönderecek. 

*.*                                                      @172.27.27.27:9000:1514


@    UDP
@@   TCP


System/Inputs a sonra da Launch new Input tıkla.
Node seç. Title ver. bind address 0.0.0.0  ver. Port 1514 yaz save et. Artık logları izleyebilirsin.