Graylog + Ubuntu

timedatectl set-timezone Asia/Hong_Kong

apt install gnupg curl

curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

apt update

apt install -y mongodb-org

systemctl start mongod
systemctl enable mongod

mongod --version

wget -qO- 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf5679a222c647c87527c2f8cb00a0bd1e2c63c11' | sudo apt-key add -

systemctl daemon-reload
systemctl enable mongod.service
systemctl restart mongod.service
systemctl --type=service --state=active | grep mongod

apt-mark hold mongodb-org

wget https://packages.graylog2.org/repo/packages/graylog-6.1-repository_latest.deb
dpkg -i graylog-6.1-repository_latest.deb
apt update
apt install graylog-datanode

cat /proc/sys/vm/max_map_count

#vm.max_map_count=262144

用下面這句生成一個密碼, 用於password_secret

< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;

vi /etc/graylog/datanode/datanode.conf
password_secret =

systemctl enable graylog-datanode.service
systemctl start graylog-datanode

apt install graylog-server
apt install graylog-enterprise

這裏輸入一個登入密碼, 放到root_password_sha2裏, 之後的admin都是用這個密碼

echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1

vi /etc/graylog/server/server.conf
password_secret
root_password_sha2:

/etc/graylog/server/server.conf
root_timezone = Asia/Hong_Kong
http_bind_address = 0.0.0.0:9000
allow_highlighting = true

http_enable_tls=true
http_tls_cert_file=/etc/graylog/ssl/xxx.pem
http_tls_key_file=/etc/graylog/ssl/xxx.key
http_publish_uri = https://xxx:9000

systemctl daemon-reload
systemctl enable graylog-server.service
systemctl start graylog-server.service
systemctl --type=service --state=active | grep graylog

tail /var/log/graylog-server/server.log

Reference:

How To Install MongoDB Server on Ubuntu 24.04 LTS


https://go2docs.graylog.org/current/downloading_and_installing_graylog/ubuntu_installation.htm

發佈留言

*