标签:typeid 出现 pen 处理 bsp schedule pre http order
nexus 的数据库备份是比较重要的,可以方便我们在故障的是时候进行应用恢复。
以下使用benthos 组件进行nexus 数据库备份事件的应用通知处理
使用docker-compose 运行
version: "3"
services:
nexus:
image: sonatype/nexus3
ports:
- "8081:8081"
volumes:
- ./nexus-data:/nexus-data
- ./backup/:/backup/
benthos:
image: jeffail/benthos
volumes:
- "./webhook.yaml:/benthos.yaml"
ports:
- "4195:4195"
smtp2http:
image: dalongrong/smtp2http
command: --listen=:25 --webhook=http://benthos:4195/ --strict=false
docker-compose up -d
使用全局webhook
注意地址使用docker-compose 内置的服务发现功能,实际上就是benthos 服务的信息
get email message: {"nodeId":"96F7F66A-20527F6B-BB8166EC-C9856291-FEAC65E0","initiator":"*TASK","audit":{"domain":"tasks","type":"started","context":"Admin - Export databases for backup","attributes":{"schedule":"Hourly{properties={schedule.startAt=2019-04-27T16:45:00.000Z, schedule.type=hourly}}","currentState":"CurrentStateImpl{state=RUNNING, nextRun=Sun Apr 28 07:45:00 UTC 2019, future=org.sonatype.nexus.quartz.internal.task.QuartzTaskFuture@74e6c97e}","lastRunState":"LastRunStateImpl{endState=OK, runStarted=Sun Apr 28 06:45:00 UTC 2019, runDuration=545}",".name":"dbbackup","lastRunState.runStarted":"1556433900003",".id":"89fe73e9-0e84-4fdc-8bd1-a29218ca1b50",".typeName":"Admin - Export databases for backup",".visible":"true",".typeId":"db.backup","lastRunState.endState":"OK",".updated":"2019-04-28T06:23:42.575Z",".recoverable":"false",".enabled":"true",".alertEmail":"dalongapp@qq.com",".message":"Admin - Export databases for backup","limitnode":"","lastRunState.runDuration":"545","location":"/backup",".created":"2019-04-28T06:23:42.575Z"}}}
benthos_1 | get email message: {"nodeId":"96F7F66A-20527F6B-BB8166EC-C9856291-FEAC65E0","initiator":"*TASK","audit":{"domain":"tasks","type":"finished","context":"Admin - Export databases for backup","attributes":{"schedule":"Hourly{properties={schedule.startAt=2019-04-27T16:45:00.000Z, schedule.type=hourly}}","currentState":"CurrentStateImpl{state=WAITING, nextRun=Sun Apr 28 07:45:00 UTC 2019, future=null}","lastRunState":"LastRunStateImpl{endState=OK, runStarted=Sun Apr 28 06:56:11 UTC 2019, runDuration=560}",".name":"dbbackup","lastRunState.runStarted":"1556434571288",".id":"89fe73e9-0e84-4fdc-8bd1-a29218ca1b50",".typeName":"Admin - Export databases for backup",".visible":"true",".typeId":"db.backup","lastRunState.endState":"OK",".updated":"2019-04-28T06:23:42.575Z",".recoverable":"false",".enabled":"true",".alertEmail":"dalongapp@qq.com",".message":"Admin - Export databases for backup","limitnode":"","lastRunState.runDuration":"560","location":"/backup",".created":"2019-04-28T06:23:42.575Z"}}}
我们可以用这个功能,使用备份好的数据,以及通知,进行nexus 备份机器的启动还原,方便在故障出现的时候,快速恢复系统,但是有一个要就,就是仓库数据
也同时做了备份,或者使用了共享存储
https://github.com/rongfengliang/nexus-webhook-for-dbexporter
标签:typeid 出现 pen 处理 bsp schedule pre http order
原文地址:https://www.cnblogs.com/rongfengliang/p/10784142.html