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. if else 和if elif else的区别

    def fuck(a): if a ==1: print(a) if a ==2: print("not good") else: print("tamade" ...

  2. 【亲测】Asp.net Mvc5 + EF6 code first 方式连接MySQL总结

    本文原文地址为:https://www.cnblogs.com/summit7ca/p/5423637.html 原文测试环境为windows 8.1+Vs2013+MySql5.7.12 本人在wi ...

  3. CNN

    <卷积神经网络详述> <卷积神经网络——雨石博客>      学习参考:http://blog.csdn.net/stdcoutzyx/article/details/4159 ...

  4. winform程序读取和改写配置文件App.config元素的值

    winform程序读取和改写配置文件App.config元素的值 2016-05-16 17:49 by newbirth, 2412 阅读, 0 评论, 收藏, 编辑 1 2 3 4 5 6 7 & ...

  5. CSS效果:不怎么样的登录表单

    HTML: <html lang="en"> <head> <meta charset="UTF-8"> <meta ...

  6. 用TSNE进行数据降维并展示聚类结果

    TSNE提供了一种有效的数据降维方式,让我们可以在2维或3维的空间中展示聚类结果. # -*- coding: utf-8 -*- from __future__ import unicode_lit ...

  7. 神州数码标准访问控制列表配置(ACL)

    实验要求:熟练掌握标准访问控制列表配置方法 拓扑如下 R1 enable 进入特权模式 config 进入全局模式 hostname R1 修改名称 interface s0/1 进入端口 ip ad ...

  8. ssh 无秘钥登录

    三台centos 一台服务器192.168.2.152 一台客户端192.168.2.142 一台客户端192.168.2.151 (1)产生无密钥 [root@localhost ~]#  ssh- ...

  9. QWaiteCondition 思考5

    1: 一个QWaiteCondition(A)  和若干个QMutex(M) 协作 同步若干个QThread. 其中QWaiteCondition(A) 中存在一个列表(listmutex)保存和其协 ...

  10. 配置两个Hadoop集群Kerberos认证跨域互信

    两个Hadoop集群开启Kerberos验证后,集群间不能够相互访问,需要实现Kerberos之间的互信,使用Hadoop集群A的客户端访问Hadoop集群B的服务(实质上是使用Kerberos Re ...