前提条件
以最少的服务器设置为基础将需要以下附加软件包:
$ sudo yum install java-1.8.0-openjdk-headless.x86_64
如果要pwgen
以后使用,则需要使用来安装系统上的EPEL并使用来安装软件包。sudo yum install epel-release
sudo yum install pwgen
MongoDB的
在CentOS上安装MongoDB应该遵循MongoDB文档中有关RHEL和CentOS的教程。首先添加/etc/yum.repos.d/mongodb-org.repo
具有以下内容的存储库文件:
[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
之后,使用安装最新版本的MongoDB 。sudo yum install mongodb-org
此外,运行以下最后步骤以在操作系统启动期间启动MongoDB并立即启动它:
$ sudo systemctl daemon-reload
$ sudo systemctl enable mongod.service
$ sudo systemctl start mongod.service
$ sudo systemctl --type=service --state=active | grep mongod
Elasticsearch
Graylog可以与Elasticsearch 6.x一起使用,请按照以下说明安装Elasticsearch的开源版本。
首先安装Elastic GPG密钥,然后添加包含以下内容的存储库文件:rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
/etc/yum.repos.d/elasticsearch.repo
[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
然后安装带有的最新版本。sudo yum install elasticsearch-oss
修改Elasticsearch配置文件 (/etc/elasticsearch/elasticsearch.yml
)并将集群名称设置为graylog
and取消注释以启用操作:action.auto_create_index: false
$ sudo vim /etc/elasticsearch/elasticsearch.yml
cluster.name: graylog
action.auto_create_index: false
修改配置后,可以启动Elasticsearch:
$ sudo systemctl daemon-reload
$ sudo systemctl enable elasticsearch.service
$ sudo systemctl restart elasticsearch.service
$ sudo systemctl --type=service --state=active | grep elasticsearch
Graylog
现在,使用以下命令安装Graylog存储库配置和Graylog本身:
$ sudo rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-3.2-repository_latest.rpm
$ sudo yum update && sudo yum install graylog-server graylog-enterprise-plugins graylog-integrations-plugins graylog-enterprise-integratio