当前位置:网站首页>一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
2022-07-05 15:34:00 【yuanfan2012】
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
由于局点(分支机构)较多,为了快速部署GrayLog单机版
所以简单整理了一下GrayLog的安装步骤脚本,来实现一键安装GrayLog Server 4.2.10单机版
只需上传GraylogServer4.2.10_install.tar.gz和GrayLogServer_install.sh安装脚本并执行一键安装脚本即可完成GrayLog Server 4.2.10单机版的安装
(图片可点击放大查看)
其中安装包和脚本的下载链接如下
链接:https://share.weiyun.com/MySqbCkG 密码:295bcq
说明:
1、GraylogServer4.2.10_install.tar.gz中为GrayLogServer安装时所需的JDK+pwgen+MongoDB+elasticsearch+graylog-server的RPM包 使用createrepo方式打包制作成本地yum源来实现离线yum安装
(图片可点击放大查看)
2、建议的资源配置如下
操作系统:CentOS7.9
CPU 8核
内存建议8GB内存以上
磁盘大小:建议单独一块数据盘,并挂载到/data目录
3、其中ES和MongoDB未做加密认证,因为只监听在本地127.0.0.1不对外暴露,若需要安全加固,请自行配置
GrayLogServer_install.sh脚本
脚本内容如下
#!/bin/bash
#关闭SELINUX
sed -i 's/enforcing/disabled/g' /etc/selinux/config
setenforce 0
#解压安装包
tar -zxvf GraylogServer4.2.10_install.tar.gz -C /opt/
mkdir /opt/yum_repo_backup
mv /etc/yum.repos.d/CentOS*.repo /opt/yum_repo_backup
cp /opt/graylog_local.repo /etc/yum.repos.d/
echo "priority=1" >> /etc/yum.repos.d/graylog_local.repo
#安装JDK+pwgen
yum install -y java-1.8.0-openjdk-headless.x86_64
yum install -y pwgen
cp /opt/yum_repo_backup/CentOS*.repo /etc/yum.repos.d/
#安装mongodb-server服务
yum install -y mongodb-org
#启动mongodb-server服务
systemctl daemon-reload
systemctl enable mongod.service
systemctl start mongod.service
systemctl --type=service --state=active | grep mongod
firewall-cmd --add-port=27017/tcp --permanent --zone=public
firewall-cmd --reload
#安装elasticsearch
yum install elasticsearch -y
#单独创建目录用于存放elasticsearch数据
mkdir -p /data/elasticsearch/data
mkdir -p /data/elasticsearch/logs
chown -R elasticsearch:elasticsearch /data/elasticsearch
cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml_default
#修改elasticsearch相关配置文件
sed -i "[email protected]#cluster.name: [email protected]: [email protected]" /etc/elasticsearch/elasticsearch.yml
sed -i "s#path.data: /var/lib/elasticsearch#path.data: /data/elasticsearch/data#g" /etc/elasticsearch/elasticsearch.yml
sed -i "s#path.logs: /var/log/elasticsearch#path.logs: /data/elasticsearch/logs#g" /etc/elasticsearch/elasticsearch.yml
#修改JVM内存大小
sed -i "s/-Xms1g/-Xms4g/g" /etc/elasticsearch/jvm.options
sed -i "s/-Xmx1g/-Xmx4g/g" /etc/elasticsearch/jvm.options
#启动elasticsearch服务
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl restart elasticsearch.service
firewall-cmd --add-port=9200/tcp --permanent --zone=public
firewall-cmd --reload
curl -s -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true'
curl -s -XGET 'http://127.0.0.1:9200/_cat/nodes?v'
#安装graylog-server服务
yum install graylog-server -y
cp /etc/graylog/server/server.conf /etc/graylog/server/server.conf_default
#修改graylog-server相关配置文件
sed -i "s/password_secret =/password_secret = 0pAHJtPdZZUb5yHAvFbBezbWAlQwh9CbRX1rshJEVxM0kV7t0SpIgY5q9tLpVEwWLElhG3EtbvQ03mTm9i0HuvWKwlWgWiIJ/g" /etc/graylog/server/server.conf
sed -i "s/root_password_sha2 =/root_password_sha2 = 79a560ed561e6fc57b3d02a59335b7710fada90625e4c661fbb7b780fb92ceaa/g" /etc/graylog/server/server.conf
sed -i "[email protected]#root_timezone = [email protected]_timezone = Asia/[email protected]" /etc/graylog/server/server.conf
sed -i "[email protected]#http_bind_address = 127.0.0.1:[email protected]_bind_address = 0.0.0.0:[email protected]" /etc/graylog/server/server.conf
sed -i "s/allow_highlighting = false/allow_highlighting = true/g" /etc/graylog/server/server.conf
#修改graylog-server启动时JVM内存大小
sed -i "s/-Xms1g -Xmx1g/-Xms2g -Xmx2g/g" /etc/sysconfig/graylog-server
firewall-cmd --add-port=9000/tcp --permanent --zone=public
firewall-cmd --reload
#启动graylog-server服务
systemctl restart graylog-server
systemctl enable graylog-server
安装过程截图如下
目前只在CentOS7.9环境下进行部署测试,其他版本未测试
[[email protected] ~]# ll
total 642960
-rw-------. 1 root root 1648 Jul 3 2021 anaconda-ks.cfg
-rw-r--r--. 1 root root 658378578 Jun 18 11:56 GraylogServer4.2.10_install.tar.gz
-rw-r--r--. 1 root root 3065 Jun 18 13:07 GrayLogServer_install.sh
[[email protected] ~]# chmod 755 GrayLogServer_install.sh
[[email protected] ~]# ./GrayLogServer_install.sh
(图片可点击放大查看)
(图片可点击放大查看)
(图片可点击放大查看)
三、登录GrayLog Web界面
账号密码为
admin/[email protected](图片可点击放大查看)
(图片可点击放大查看)
(图片可点击放大查看)
Tips
若需要修改admin登录密码请使用如下命令
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
并修改/etc/graylog/server/server.conf 中root_password_sha2值
重启Graylog服务生效
边栏推荐
- Transfer the idea of "Zhongtai" to the code
- ES6深入—ES6 Class 类
- MySQL table field adjustment
- Anti shake and throttling
- Coding devsecops helps financial enterprises run out of digital acceleration
- vlunhub- BoredHackerBlog Social Network
- Vulnhub-Moneybox
- verilog实现计算最大公约数和最小公倍数
- [brief notes] solve the problem of IDE golang code red and error reporting
- 六种常用事务解决方案,你方唱罢,我登场(没有最好只有更好)
猜你喜欢
![18.[stm32] read the ROM of DS18B20 temperature sensor and realize multi-point temperature measurement](/img/e7/4f682814ae899917c8ee981c05edb8.jpg)
18.[stm32] read the ROM of DS18B20 temperature sensor and realize multi-point temperature measurement

Data communication foundation - routing communication between VLANs

抽象类和接口的区别

obj集合转为实体集合

Use of set tag in SQL

Anti shake and throttling

Appium automation test foundation - appium basic operation API (I)

一文搞定vscode编写go程序

Intelligent metal detector based on openharmony

【 note 】 résoudre l'erreur de code IDE golang
随机推荐
【毕业季】作为一名大二计科在校生,我有话想说
Why should we learn mathematical modeling?
[brief notes] solve the problem of IDE golang code red and error reporting
Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022
RepLKNet:不是大卷积不好,而是卷积不够大,31x31卷积了解一下 | CVPR 2022
[Netease Yunxin] research and practice of super-resolution technology in the field of real-time audio and video
Noi / 1.5 37: mercenaries
F. Weights assignment for tree edges problem solving Report
【简记】解决IDE golang 代码飘红报错
Data communication foundation OSPF Foundation
Transfer the idea of "Zhongtai" to the code
20. [stm32] realize the function of intelligent garbage can by using ultrasonic module and steering gear
Basic JSON operations of MySQL 5.7
记录一下树莓派搭建环境中遇到的坑。。。
抽象类和接口的区别
Noi / 1.3 01: a+b problem
DataArts Studio数据架构——数据标准介绍
swiper. JS to achieve barrage effect
MySQL5.7的JSON基本操作
Summary of the third class