2024/05/09
2023/10/14
最近nas因為更新發生nfs不能使用的問題
因此暫時把graylog搬到其他台還沒更新的nas上
搬完後發現ES變成red
下指令看一下是那些shards
curl -XGET localhost:9200/_cat/shards|grep UNASSIGNED
index.action 0 r UNASSIGNED
index.do 0 r UNASSIGNED
index.aspx 0 r UNASSIGNED
graylog_159 2 p UNASSIGNED
index.htm 0 r UNASSIGNED
index.py 0 r UNASSIGNED
index.php 0 r UNASSIGNED
index.cgi 0 r UNASSIGNED
index.html 0 r UNASSIGNED
index.cfm 0 r UNASSIGNED
index.pl 0 r UNASSIGNED
index.jsp 0 r UNASSIGNED
index.asp 0 r UNASSIGNED
2023/02/11
2022/12/16
graylog 迎來了5 版的更新
依然還是無法原几升級
記錄一下安裝的過程 以debian 11 為例
依照官方文件的流程 先裝mongodb
由於新版的mongodb需要使用 cpu 的 avx 功能
所以proxmox 上 guest的 cpu type 必須要改成 host 不能使用 預設值 kvm64
光是這個問題就卡關好久
而且mongodb 5版裝完後無法執行 6 版沒問題
接下來新的版本可以選擇使用
OpenSearch 或 Elasticsearch
以上的參數依照記憶体進行調整
/etc/default/graylog-server 檔案裡
GRAYLOG_SERVER_JAVA_OPTS="-Xms1g -Xmx1g -server -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow"
-Xms1g -Xmx1g
這二個參數也是依照記憶体進行調整
其他依文件安裝問題不大
不過文件上有些斷行有問題 需要自行調整
例如
wget -qO - https://www.mongodb.org/static/pgp/server-5.x.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.x main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.x.list
及
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
另外使用almalinux 8 跟 9 安裝過程沒有出現錯誤 但 graylog server 啟動打開管理介面
出現以下的錯誤
不知道是那裡出問題 有空再來試了
找到問題了 firewalld 沒關
systemctl disable firewalld
systemctl stop firewalld
https://go2docs.graylog.org/5-0/what_is_graylog/what_is_graylog.htm
2020/11/24
今天升graylog 4
稍微記一下
如果還有其碰到其他問題
之後再補上
官方提供的ova是 ubuntu 18.04
這個很怪 要用就只能用二年多到 2023
為什麼不直接用2004
所以決定不用ova 直接在centos 8裝
照官方文件 安裝沒什麼問題
https://docs.graylog.org/en/4.0/pages/installation/os/centos.html#centosguide
裝完後要調整 graylog 和 elasticsearch的 記憶体參數
/etc/elasticsearch/jvm.options
-Xms4g
-Xmx4g
/etc/sysconfig/graylog-server
/etc/elasticsearch/elasticsearch.yml
在之前的版本只要加上以下這行就可以
network.host: 0.0.0.0
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
還要再加上以下這行
discovery.seed_hosts: ["127.0.0.1"]
legacy 的search 只剩json輸出的沒問題 另外二個都撈不出資料
2020/11/06
最近有人問到 elasticsearch 備分還原的問題
做個記錄
由於 elasticsearch 安裝完成後預設只能本几連線
所以/etc/elasticsearch/elasticsearch.yml
最後加上
network.host: 0.0.0.0
允許本几以外的連線
加完後elasticsearch要重啟才會生效
接下來在目的机上停止 graylog
systemctl stop graylog-server
curl -XGET 'http://localhost:9200/_cat/indices'
依需求在目的几上建立indeces
curl -X PUT "localhost:9200/graylog_514?pretty"
加完後就可以使用 esm 直接複制 indices 順序從小到大
./esm -s http://10.0.0.247:9200 -d http://10.0.0.234:9200 -x graylog_514 -y graylog_514
如果想要備份後再還原 則使用以下指令
備份
./esm -s http://10.0.0.247:9200 -x graylog_455 -o dump.json
還原
./esm -i dump.json -d http://10.0.0.234:9200 -y graylog_455
處理完成後 start graylog
systemctl start graylog-server
要 recalculate index ranges
Indices & Index Sets - Default index set - recalculate index ranges
以上的做法不會更動原資料的時間序
https://github.com/medcl/esm
https://elasticsearch.cn/article/13773
https://community.graylog.org/t/after-data-recovery-not-seeing-data-in-search/13423
2019/11/01
2019/09/07
說本來可以正常運作
但改完ip後
就收不到資料了
連進去看之後先df看了一下 發現HD的使用率很高
然後ES的log出現以下的訊息
[INFO ][cluster.routing.allocation.decider] [Milan] low disk watermark [15%] exceeded on [DZqnmWIZRpapZY_TPkkMBw][Milan] free: 58.6gb[12.6%], replicas will not be assigned to this node
curl -u admin:password -XDELETE http://10.1.2.3:9200/graylog_0
再關掉index
curl -u admin:password -XPOST 'http://10.1.2.3:9200/graylog_4/_close'
以下是列出所有index的指令
curl -u admin:password 'http://10.1.2.3:9200/_cat/indices/graylog*?v'
所以關掉一個後就正常了
curl -u admin:password -XPOST 'http://10.1.2.3:9200/graylog_5/_close'

