linux搭建Gray

1、组件版本选定

|---------------|------------------------------------|
| 组件 | 版本号 |
| Graylog | 4.2.10 |
| MongoDB | 4.4.14 |
| Elasticsearch | 7.10.2 |
| jdk | java-1.8.0-openjdk-headless.x86_64 |

2、安装密码指令

# 安装pwd yum install -y pwgen

3、安装MongoDB

1、配置yum仓库

# 修改yum仓库配置 vim /etc/yum.repos.d/mongodb-org.repo # 加入一下内容 [mongodb-org-4.4] name=MongoDBRepository 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

2、安装MongoDB

# 安装MongoDB yum -y install mongodb-org # 查看版本号 mongo --version sudo systemctl daemon-reload # 设置开机自启 sudo systemctl enable mongod.service # 启动MongoDB sudo systemctl start mongod.service # 查看状态 sudo systemctl --type=service --state=active | grep mongod

3、安装Elastic GPG key并配置yum仓库

# 安装Elastic GPG key rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch # 配置yum仓库.这里这种方式跟vim本质一样都是写数据到/etc/yum.repos.d/elasticsearch.repo中,只不过这种更方便 cat > /etc/yum.repos.d/elasticsearch.repo <<EOF [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 EOF

4、安装Elasticsearch

# 安装es yum -y install elasticsearch-oss # 修改Elasticsearch配置文件 cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml_default 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 # 查看版本信息 curl -XGET localhost:9200

5、安装graylog

# 安装4.2 sudo rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-4.2-repository_latest.rpm # 安装graylog服务,包含了插件。如果不需要安装插件,只安装sudo yum install graylog-server sudo yum install graylog-server graylog-enterprise-plugins graylog-integrations-plugins graylog-enterprise-integrations-plugins

6、配置密码

配置password_secretroot_password_sha2,未配置graylog无法启动。文件路径:/etc/graylog/server/server.conf 创建password_secret,需要使用pwgen工具

# 生成96的安全密码,将生成的密码配置到password_secret即可。 pwgen -1 -s 96 # 示例结果如下 smypspdHATo9vGHTM6VUl4dtIjaI32okPekLCdQ5yiD7iakUwdY9w9LFH9sVA5qNZ8tFmnq0S65QNnLOxYdyyLMbtWg8H7bk

7、集群部署,多个节点的 password_secret需要相同,部署启动后这个值不要随便修改,修改后数据库中的所有用户的会话都会失效。

创建root_password_sha2,也就是admin账号的登录密码,这里我配置成admin

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

8、配置http_bind_address

文件路径:/etc/graylog/server/server.conf http_bind_address需要配置外部可访问到graylog的IP和地址,可以是域名或IP。默认为127.0.0.1:9000。配置成0.0.0.0:9000即可。

9、启动

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

10、具体代码图示

相关推荐
sszdzq13 分钟前
Docker
运维·docker·容器
book012117 分钟前
MySql数据库运维学习笔记
运维·数据库·mysql
bugtraq20211 小时前
XiaoMi Mi5(gemini) 刷入Ubuntu Touch 16.04——安卓手机刷入Linux
linux·运维·ubuntu
xmweisi1 小时前
【华为】报文统计的技术NetStream
运维·服务器·网络·华为认证
VVVVWeiYee1 小时前
BGP配置华为——路径优选验证
运维·网络·华为·信息与通信
陆鳐LuLu2 小时前
日志管理利器:基于 ELK 的日志收集、存储与可视化实战
运维·elk·jenkins
DC_BLOG2 小时前
Linux-GlusterFS进阶分布式卷
linux·运维·服务器·分布式
cookies_s_s3 小时前
Linux--进程(进程虚拟地址空间、页表、进程控制、实现简易shell)
linux·运维·服务器·数据结构·c++·算法·哈希算法
zhouwu_linux3 小时前
MT7628基于原厂的SDK包, 修改ra1网卡的MAC方法。
linux·运维·macos
诶尔法Alpha4 小时前
Linux上使用dify构建RAG
linux·运维·服务器