夜莺v6.1.0,增加n9e部署多个节点(共用数据库),主机告警异常

Viewed 63

多个夜莺节点,共用数据库,新增的节点显示监控对象没有心跳,频繁触发告警。(尝试让新增节点,修改告警引擎名称也不行)
新版本不支持集群?主机告警这块怎么处理?

2 Answers

要不贴一下配置信息和日志

就是单纯的部署了一套夜莺,使用同样的配置

配置如下,帮忙看看,不然没办法部署集群了

[Global]
RunMode = "release"

[Log]

log write dir

Dir = "logs"

log level: DEBUG INFO WARNING ERROR

Level = "DEBUG"

stdout, stderr, file

Output = "stdout"

# rotate by time

KeepHours = 4

# rotate by size

RotateNum = 3

# unit: MB

RotateSize = 256

[HTTP]

http listening address

Host = "0.0.0.0"

http listening port

Port = 29000

https cert file path

CertFile = ""

https key file path

KeyFile = ""

whether print access log

PrintAccessLog = false

whether enable pprof

PProf = false

expose prometheus /metrics?

ExposeMetrics = true

http graceful shutdown timeout, unit: s

ShutdownTimeout = 30

max content length: 64M

MaxContentLength = 67108864

http server read timeout, unit: s

ReadTimeout = 20

http server write timeout, unit: s

WriteTimeout = 40

http server idle timeout, unit: s

IdleTimeout = 120

[HTTP.ShowCaptcha]
Enable = false

[HTTP.APIForAgent]
Enable = true

[HTTP.APIForAgent.BasicAuth]

user001 = "ccc26da7b9aba533cbb263a36c07dcc5"

[HTTP.APIForService]
Enable = true
[HTTP.APIForService.BasicAuth]
n9ev610admin = "n9ev610admin"

[HTTP.JWTAuth]

signing key

SigningKey = "5b94a0fd640fe2765af826acfe42d151"

unit: min

AccessExpired = 1500

unit: min

RefreshExpired = 10080
RedisKeyPrefix = "/jwt/"

[HTTP.ProxyAuth]

if proxy auth enabled, jwt auth is disabled

Enable = false

username key in http proxy header

HeaderUserNameKey = "X-User-Name"
DefaultRoles = ["Standard"]

[HTTP.RSA]

open RSA

OpenRSA = false

RSA public key

RSAPublicKeyPath = "/etc/n9e/public.pem"

RSA private key

RSAPrivateKeyPath = "/etc/n9e/private.pem"

RSA private key password

RSAPassWord = ""

[DB]
DSN="root:xxx@tcp(addr:3306)/n9e_new?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"

enable debug mode or not

Debug = false

mysql postgres

DBType = "mysql"

unit: s

MaxLifetime = 7200

max open connections

MaxOpenConns = 150

max idle connections

MaxIdleConns = 50

table prefix

TablePrefix = ""

enable auto migrate or not

EnableAutoMigrate = false

[Redis]

address, ip:port or ip1:port,ip2:port for cluster and sentinel(SentinelAddrs)

Address = "addr:6379"

Username = ""

Password = xxx

DB = 0

UseTLS = false

TLSMinVersion = "1.2"

standalone cluster sentinel

RedisType = "standalone"

Mastername for sentinel type

MasterName = "mymaster"

SentinelUsername = ""

SentinelPassword = ""

[Alert]
[Alert.Heartbeat]

auto detect if blank

IP = ""

unit ms

Interval = 1000
EngineName = "master228"

[Alert.Alerting]

NotifyConcurrency = 10

[Center]
MetricsYamlFile = "./etc/metrics.yaml"
I18NHeaderKey = "X-Language"

[Center.AnonymousAccess]
PromQuerier = true
AlertDetail = true

[Pushgw]

use target labels in database instead of in series

LabelRewrite = true

# default busigroup key name

BusiGroupLabelKey = "busigroup"

ForceUseServerTS = false

[Pushgw.DebugSample]

ident = "xx"

name = "xx"

[Pushgw.WriterOpt]

QueueMaxSize = 1000000

QueuePopSize = 1000

[[Pushgw.Writers]]
Url = "http://addr:8428/api/v1/write"

Basic auth username

BasicAuthUser = ""

Basic auth password

BasicAuthPass = ""

timeout settings, unit: ms

Headers = ["X-From", "n9e"]
Timeout = 10000
DialTimeout = 3000
TLSHandshakeTimeout = 30000
ExpectContinueTimeout = 1000
IdleConnTimeout = 90000

time duration, unit: ms

KeepAlive = 30000
MaxConnsPerHost = 0
MaxIdleConns = 100
MaxIdleConnsPerHost = 100

Optional TLS Config

UseTLS = false

TLSCA = "/etc/n9e/ca.pem"

TLSCert = "/etc/n9e/cert.pem"

TLSKey = "/etc/n9e/key.pem"

InsecureSkipVerify = false

[[Writers.WriteRelabels]]

Action = "replace"

SourceLabels = ["address"]

Regex = "([^:]+)(?::\d+)?"

Replacement = "$1:80"

TargetLabel = "address"