CentOS7.9+OpenSearch2.7环境下安装GrayLog5.1
关于OpenSearch
2021 年,开发Elasticsearch 和Kibana的Elastic公司宣布更改许可证,此举旨在禁止云服务商如AWS使用它的软件作为一种服务提供给客户,但这也意味着这两个软件不再是开源软件。发生此事的原因是,Elastic认为云服务商只使用开源软件,而不向开源软件做贡献。
AWS 随后宣布创建ElasticSearch开源分支OpenSearch,承诺会向其提交贡献。如今,OpenSearch 下载量突破1亿,包括AWS员工在内的496名贡献者递交了8760个拉取请求,Adobe也决定在其套件中用OpenSearch取代Elasticsearch,它甚至还进入了DB-Engines 数据库流行度排名前五十。
下面介绍CentOS7.9+OpenSearch2.7环境下安装GrayLog5.1
具体步骤如下
一、安装MongoDB6.0
vim /etc/yum.repos.d/mongodb-org.repo
添加如下行 [mongodb-org-6.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/6.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
(图片点击放大查看)
yum install -y mongodb-org systemctl daemon-reload systemctl enable mongod systemctl start mongod systemctl status mongod
(图片点击放大查看)
(图片点击放大查看)
二、安装opensearch2.7
curl -SL https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/opensearch-2.x.repo -o /etc/yum.repos.d/opensearch-2.x.repo cat /etc/yum.repos.d/opensearch-2.x.repo yum install -y opensearch
(图片点击放大查看)
vim /etc/opensearch/opensearch.yml 修改如下行 cluster.name: graylog node.name: graylog path.data: /data/opensearch/data path.logs: /data/opensearch/logs network.host: 0.0.0.0 discovery.type: single-node action.auto_create_index: false plugins.security.disabled: true cat /etc/opensearch/opensearch.yml | grep -v ^#
(图片点击放大查看)
cat /etc/passwd| grep opensearch mkdir -p /data/opensearch/data mkdir -p /data/opensearch/logs chown -R /data/opensearch chown -R opensearch /data/opensearch sysctl -w vm.max_map_count=262144 echo 'vm.max_map_count=262144' >> /etc/sysctl.conf systemctl daemon-reload systemctl enable opensearch systemctl start opensearch systemctl status opensearch
(图片点击放大查看)
三、安装GrayLog5.1
rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-5.1-repository-1-2.noarch.rpm cd /etc/yum.repos.d/ cat graylog.repo yum install graylog-server
(图片点击放大查看)
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1 < /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;
(图片点击放大查看)
vim /etc/graylog/server/server.conf 修改如下行 password_secret = UdDDEVDpQaBKzMeNb2UCOclA2vcepjGSp4XTaVFZ0EXGz5toA9DI091Wufy0TaGT39j6R4Ymp0ogmmftE9sPrmQXo5QWjDQj root_password_sha2 = 429d280c5ddad83d94770b077b22124231efc727d504b107883297304b3e2939 root_timezone = Asia/Shanghai http_bind_address = 0.0.0.0:9000 allow_highlighting = true cat /etc/graylog/server/server.conf | grep -v ^# | grep -v ^$
(图片点击放大查看)
systemctl daemon-reload systemctl enable graylog-server.service systemctl start graylog-server.service systemctl --type=service --state=active | grep graylog firewall-cmd --permanent --zone=public --add-port=9000/tcp firewall-cmd --reload
(图片点击放大查看)
四、登录Graylog5.1
(图片点击放大查看)
(图片点击放大查看)