当前位置:网站首页>一键安装脚本实现快速部署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服务生效
边栏推荐
- 研发效能度量指标构成及效能度量方法论
- 17. [stm32] use only three wires to drive LCD1602 LCD
- [brief notes] solve the problem of IDE golang code red and error reporting
- vant popup+其他组件的组合使用,及避坑指南
- CSDN I'm coming
- How difficult is it to pass the certification of Intel Evo 3.0? Yilian technology tells you
- MySQL table field adjustment
- The list set is summed up according to a certain attribute of the object, the maximum value, etc
- Parameter type setting error during batch update in project SQL
- abstract关键字和哪些关键字会发生冲突呢
猜你喜欢
Appium automation test foundation - appium basic operation API (I)
Five common negotiation strategies of consulting companies and how to safeguard their own interests
vulnhub-Root_ this_ box
Example project: simple hexapod Walker
Verilog realizes the calculation of the maximum common divisor and the minimum common multiple
Clock switching with multiple relationship
The difference between abstract classes and interfaces
vlunhub- BoredHackerBlog Moriarty Corp
Research and practice of super-resolution technology in the field of real-time audio and video
Six common transaction solutions, you sing, I come on stage (no best, only better)
随机推荐
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
Arduino控制微小的六足3D打印机器人
Codasip adds verify safe startup function to risc-v processor series
Batch update in the project
研发效能度量指标构成及效能度量方法论
List de duplication and count the number
vant tabbar遮挡内容的解决方式
Boost the development of digital economy and consolidate the base of digital talents - the digital talent competition was successfully held in Kunming
OSI seven layer model
Example project: simple hexapod Walker
Which keywords will conflict with the abstract keyword
wyt 。。
Virtual base class (a little difficult)
Modify PyUnit_ Time makes it support the time text of 'xx~xx months'
sql中查询最近一条记录
21. [STM32] I don't understand the I2C protocol. Dig deep into the sequence diagram to help you write the underlying driver
超分辨率技术在实时音视频领域的研究与实践
list集合根据对象某属性求和,最大值等
Query the latest record in SQL
Noi / 1.3 01: a+b problem