我们直接开始
- 基础环境和java
sudo yum install epel-release
并安装带有
sudo yum install pwgen
yum install java-1.8.0-openjdk-headless.x86_64
-
MONGODB 安装数据库
vi /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
执行安装
sudo yum install mongodb-org
启动
sudo systemctl daemon-reload
sudo systemctl enable mongod.service
sudo systemctl start mongod.service
sudo systemctl --type=service --state=active | grep mongod
- 安装 ELASTICSEARCH
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
vi /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/oss-7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
安装和启动
sudo yum install elasticsearch-oss
vi /etc/elasticsearch/elasticsearch.yml
# 返注释最后一行action.auto_create_index: false
sudo tee -a /etc/elasticsearch/elasticsearch.yml > /dev/null <<EOT
cluster.name: graylog
action.auto_create_index: false
EOT
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl restart elasticsearch.service
sudo systemctl --type=service --state=active | grep elasticsearch
- 安装GRAYLOG
sudo rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-4.3.8-repository_latest.rpm
sudo yum install -y graylog-server graylog-enterprise-plugins graylog-integrations-plugins graylog-enterprise-integrations-plugins
#安装完成后,首先生成password_secret密码
pwgen -N 1 -s 96
#要创建您的root_password_sha2 运行以下命令:
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
vi /etc/graylog/server/server.conf
编辑
生成的secret 和密码填入配置文件中
注意时区
root_timezone = Asia/Shanghai
以及ip
http_bind_address = 0.0.0.0:9000
最后启动
#启动graylog
sudo systemctl daemon-reload
sudo systemctl enable graylog-server.service
sudo systemctl start graylog-server.service
sudo systemctl --type=service --state=active | grep graylog
- 注意关闭 SELinux