Graylog安装入门

Graylog安装入门1 官网地址 https www graylog org 安装文档连接 https docs graylog org en 4 0 pages installation operating system packages htmljdk 安装见另一篇文章 mongoDB 安装 vim etc yum repos d mongodb org repo mongodb org 4 2 name MongoDBRepos htt

1.官网地址 Industry Leading Log Management | Graylog

Graylog安装入门

安装文档连接 Operating System Packages – Installing Graylog

Graylog安装入门

Graylog安装入门

jdk安装见另一篇文章

mongoDB安装

vim /etc/yum.repos.d/mongodb-org.repo [mongodb-org-4.2] name=MongoDB Repository 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

安装 sudo yum install mongodb-org 启动 sudo systemctl daemon-reload sudo systemctl enable mongod.service sudo systemctl start mongod.service sudo systemctl --type=service --state=active | grep mongod

es安装

首先安装Elastic GPG密钥,然后添加包含以下内容的存储库文件中,graylog4.1采用的是elasticsearch7.x版本

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch touch /etc/yum.repos.d/elasticsearch.repo vim /etc/yum.repos.d/elasticsearch.repo 

[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

随后安装最新版本

sudo yum install elasticsearch-oss

修改elasticsearch的配置文件

vim /etc/elasticsearch/elasticsearch.yml 修改 cluster.name: graylog 最后一行新增 action.auto_create_index: false

启动es

sudo systemctl daemon-reload sudo systemctl enable elasticsearch.service sudo systemctl restart elasticsearch.service sudo systemctl --type=service --state=active | grep elasticsearch
修改elasticsearch的jvm配置,按实际物理机器可用分配内存配置 vim /etc/elasticsearch/jvm.options 初始化内存 -Xms1g 最小内存 -Xmx1g

graylog安装

sudo rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-4.0-repository_latest.rpm

最简单安装

sudo yum install graylog-server

集成众多插件安装

sudo yum install graylog-server graylog-enterprise-plugins graylog-integrations-plugins graylog-enterprise-integrations-plugins

安装epel软件仓库

yum install epel-release

安装pwgen生成密码

yum install pwgen

生成password_secret密码

[root@graylog mydata]# pwgen -N 1 -s 96 aSWvfG4xcs9Hvt9F5D8loE5bPWfuH3zhwHS2aSv0tpGC1BLRn87pj37sYQIxxyea8tFRlPLy0ce4jITy6Bq5RUO4BGVEBO4r

生成root_password_sha2密码 (Web登录时所需要使用的密码)

[root@graylog mydata]# echo -n "Enter Password: " && head -1 

修改配置文件

vim /etc/graylog/server/server.conf password_secret = aSWvfG4xcs9Hvt9F5D8loE5bPWfuH3zhwHS2aSv0tpGC1BLRn87pj37sYQIxxyea8tFRlPLy0ce4jITy6Bq5RUO4BGVEBO4r Web登录时所需要使用的密码 root_password_sha2 = 24889f9abcf227d18ed564ced121b17e58265cc5373e8bbb03fc72f2b64782c7 配置时区 root_timezone = Asia/Shanghai 绑定ip地址 http_bind_address = 0.0.0.0:9000 # 配置外网地址,我这里用了域名+nginx做反向代理,所以外网地址如下。没有的话就直接就用外网ip+port,如:http://外网ip:9000/ http_publish_uri = http://graylog.example.com/ # http_external_uri = http://graylog.example.com/ 单节点的话,此配置不需要配置,默认使用http_publish_uri 由于ES是单节点,修改分片设置为 1 elasticsearch_shards = 1 elasticsearch_replicas = 0 查询结果高亮 allow_highlighting = true 邮件预警配置 邮件预警配置 transport_email_enabled = true transport_email_hostname = smtp.exmail..com transport_email_port = 465 transport_email_use_auth = true transport_email_auth_username =  transport_email_auth_password = xxxxx transport_email_subject_prefix = [graylog] transport_email_from_email =  transport_email_use_tls = false transport_email_use_ssl = true 可选http通知 transport_email_web_interface_url = http://graylog.example.com 其他可选配置 # elasticsearch 相关配置 elasticsearch_hosts = http://127.0.0.1:9200 elasticsearch_shards =1 elasticsearch_replicas = 0 # mongodb 连接配置,这里直接本机起的mongodb,没有设置验证 mongodb_uri = mongodb://localhost/graylog

为java执行目录建立软连接

ln -s /usr/local/jdk1.8.0_191/bin/java /usr/bin/java

或者

# 启动需要手动设置Java路径 vim /etc/sysconfig/graylog-server --------------------------------------------------------------------------------- JAVA=/usr/local/jdk1.8.0_191/bin/java ---------------------------------------------------------------------------------

日志目录

tail -50f /var/log/graylog-server/server.log tail -50f /var/log/messages

启动

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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/200516.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月20日 上午10:40
下一篇 2026年3月20日 上午10:40


相关推荐

  • 单片机spi通信_stm32单片机常用的片内外设

    单片机spi通信_stm32单片机常用的片内外设提示:若转载,请备注来源,谢谢!文章目录前言一、SPI协议是什么?1.优点2.缺点3.结构二、SPI协议1.模式概念理解2.通信过程分析3.SPI个人协议理解总结前言题目上写的是单片机,其实不管你的板子上不上系统(FreeRtos、Linux),协议都是不变的。题外话:工作过程中,一直在移植别人写好的SPI协议,然后和外设的芯片(例如:Flash芯片、NFC芯片等)进行通信,但是都没有往底层深入的看,下午看了照着代码看了三个多小时,写这篇博客作为总结。一、SPI协议是什么?S

    2022年10月9日
    5
  • ManualResetEvent类的用法

    ManualResetEvent类的用法ManualResetEvent类作用1.事件初始状态设为false,task线程在第一个WaitOne()处阻塞。2.manualResetEvent.Set()事件状态设为true,task线程在每一个WaitOne()处都不阻塞。3.manualResetEvent调用Set()再调用Reset(),task线程在第一个WaitOne()处阻塞。4.manualResetEvent.Set()事件状态设为true,task线程在第一个WaitOne()处阻塞然后被释放。5.三个线程异步执行,set()

    2022年7月18日
    24
  • Ubuntu 18.04 安装过程记录

    Ubuntu 18.04 安装过程记录Ubuntu18 04 安装过程记录目录 Ubuntu18 04 安装过程记录前言安装步骤制作启动 U 盘分区与设置启动项安装 Ubuntu 系统 Ubuntu 系统换源更改 Windows 启动顺序参考教程 Ubuntu18 04 安装过程记录前言我之前安装的 Linux 系统是 Ubuntu16 04 然而这个版本只支持到今年 4 月份 再加上我之前因为安装 Ubuntu 系统给电脑本来的固态硬盘分了很大一部分内存出去 256G 内存容量太小啊难受 导致现在 Windows 系统下可用的内存就少得可怜 有很多必要软件都只能

    2026年3月18日
    2
  • 阿里巴巴加码争夺AI Agent市场 天地在线涨停

    阿里巴巴加码争夺AI Agent市场 天地在线涨停

    2026年3月16日
    2
  • 安卓手机获取root权限

    安卓手机获取root权限安卓手机获取 root 权限

    2026年3月18日
    2
  • Laravel 5.6 安装 guzzlehttp

    Laravel 5.6 安装 guzzlehttp

    2021年10月24日
    76

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号