nexus 的数据库备份是比较重要的,可以方便我们在故障的是时候进行应用恢复。
以下使用benthos 组件进行nexus 数据库备份事件的应用通知处理

环境准备

使用docker-compose 运行

  • docker-compose.yaml 文件
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
  • 说明
    如果出现权限的问题,可以直接设置777 权限,简单(但是不是很合理)chmod 777 backup nexus-data

配置webhook 功能

使用全局webhook

  • 配置全局audit webhook

注意地址使用docker-compose 内置的服务发现功能,实际上就是benthos 服务的信息

  • 配置db exporter 任务
    如下

运行任务&&查看效果

  • 启动任务
    直接点击run运行配置的db exporter 任务
  • 效果
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

 
 
 
 

nexus 数据库备份任务webhook 通知的更多相关文章

  1. nexus 数据库备份任务webhook 通知-另外一种方法

    使用benthos 做为webhook,是一种方法,功能很强大,但是有点复杂,所以换了一个更简单直接的webhook 工具 根据请求的数据,只处理关于db exporter 任务部分的消息,然后就是调 ...

  2. C#.NET SQL数据库备份与还原解决方案

    C#.NET SQL数据库备份与还原解决方案http://www.csframework.com/archive/1/arc-1-20110924-1841.htm 开发框架V2.2(快速开发版)系统 ...

  3. OCA读书笔记(15) - 执行数据库备份

    物理备份 -- 数据文件,控制文件,日志文件,参数文件 数据库备份 冷备 -- 归档和非归档均可以 什么时候必须用冷备?1. 数据库的模式为非归档的2. 用于现场保护 冷备的过程:1. 首先查看备份文 ...

  4. mysql 数据库备份ubuntu

    安装 1 sudo apt-get update 2. sudo apt-get install mysql-server 3 sudo  apt-get install mysql-client 4 ...

  5. 知识点:linux数据库备份

    服务端启用二进制日志 如果日志没有启开,必须启用binlog,要重启mysql,首先,关闭mysql,打开/etc/my.cnf,加入以下几行: [mysqld] log-bin 然后重新启动mysq ...

  6. linux数据库备份

    linux数据库备份 服务端启用二进制日志 如果日志没有启开,必须启用binlog,要重启mysql,首先,关闭mysql,打开/etc/my.cnf,加入以下几行: [mysqld] log-bin ...

  7. Oracle 数据库备份和恢复配置

    可能的失败及其解决方法 失败类型 我们坑你遇到的失败或错误分为两大类:物理和逻辑.物理错误一般是硬件错误或使用数据库的应用程序中的软件错误,而逻辑错误一般在终端用户级别(数据库用户和管理员). 按从轻 ...

  8. Oracle数据库备份恢复,巡检须要关注的对象设置以及相关恢复概述

    数据库备份恢复.巡检须要关注的对象设置: 1.数据库名称,以及DBID:  --dbid在v$database中     SYS@ORCL>select dbid,name from v$dat ...

  9. 阿里云数据库备份DBS商业化发布,数据库实时备份到OSS

    数据库备份DBS已于2018年5月17日正式商业化发布. 数据库备份(Database Backup,简称DBS)是为数据库提供连续数据保护.低成本的备份服务. 它可以为多种环境的数据提供强有力的保护 ...

随机推荐

  1. 用 LSTM 做时间序列预测的一个小例子(转自简书)

    问题:航班乘客预测 数据:1949 到 1960 一共 12 年,每年 12 个月的数据,一共 144 个数据,单位是 1000 下载地址 目标:预测国际航班未来 1 个月的乘客数 import nu ...

  2. 常见的操作系统及linux发展史

    目前我们常见的操作系统有: 1> 桌面操作系统 Windows 系列 用户群体大 macOS 适合于开发人员 Linux 应用软件少 2> 服务器操作系统 Linux 安全.稳定.免费 占 ...

  3. git pull提交代码遇到的问题

    git pull 提示如下错误 解决方法: git pull 后面加上分支具体地址  比如:git pull origin daily/1.0.0 同样git push origin daily/1. ...

  4. 字典序UVa 1584 Circular Sequence

    #include <iostream> #include <algorithm> #include <cmath> #include <cstdio> ...

  5. linux服务器升级nginx

    1.简介 有时候nginx发布了新BUG或者添加了新的功能时,想要更新的时候服务又不能中断,这时候就要用到nginx的平滑升级了. 该脚本同样适用于添加新扩展,添加新扩展的时候只需要把更新的版本修改为 ...

  6. Linux:PCBSD系统的安装

    这期继续更新有关Linux系统的安装步骤以及使用,感兴趣的可以来看下!!! 安装PCBSD系统 系统映像文件下载 PCBSD 9.2官方正式版:http://www.veryhuo.com/down/ ...

  7. tomcat 内存溢出处理方案

    找到tomcat7w.exe  在java  页 java options 最后添加 -XX:PermSize=256m-XX:MaxPermSize=512m

  8. dos6章

    现在开始: 在CMD使用IF /?打开IF的系统帮助(自己看我就不全部列出来了),我们会发现IF有3种基本的用法!执行批处理程序中的条件处理. IF [NOT] ERRORLEVEL number c ...

  9. Date对象方法

    创建Date               new  Date() Date对象方法: get系列: getDate()            返回一个月中的某一天(1-31) getDay()    ...

  10. python day32--struct,文件上传下载

    一.struct模块 可以把要发送的数据长度转换成固定长度的字节 struct.pack('i',数据长度) struct.unpack('i',数据长度) 二.上传下载文件作业 server imp ...