1 Star 0 Fork 1

李通 / litongjava-jfinal-monitoring-db

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
readme.md

litongjava-jfinal-monitoring-db

背景

mysql数据库和oraclse数据库因为安装windows上,经常宕机,连接不上,用了很久,也不方便迁移

简介

通过定时任务,连接数据库,连接失败发送邮件报警

演示视频

https://www.bilibili.com/video/bv1xp4y1a7i7

安装

1.1.1.解压工程

#创建package目录
mkdir /opt/package && cd /opt/package
#上传litongjava-jfinal-monitoring-db-1.0-release.tar.gz到此目录
#解压工程
tar -xf litongjava-jfinal-monitoring-db-1.0-release.tar.gz -C /usr/local/plisp/

1.1.2.创建数据库
数据库是mariadb
1.连接数据库

mysql -uroot -probot_123456# -h127.0.0.1

2.创建存储库

create database monitoring_db default character set utf8;

3.切换到数据库

use monitoring_db;

4.导入数据

source /usr/local/plisp/litongjava-jfinal-monitoring-db-1.0/doc/monitoring_db.sql

1.1.3.安装项目
配置数据库连接
1.进入配置目录

cd /usr/local/plisp/litongjava-jfinal-monitoring-db-1.0

2.修改配置文件

vi config/undertow.properties

配置为对于的账号和密码

jdbc.url=jdbc:mysql://localhost/monitoring_db?characterEncoding=UTF8&serverTimezone=UTC
jdbc.user=root
jdbc.pswd=robot_123456#

1.1.4.启动项目 1.进入配置目录

cd /usr/local/plisp/litongjava-jfinal-monitoring-db-1.0

2.启动项目

./jfinal.sh restart

1.1.5.配置nginx
nginx的主要配置如下

  location /monitoring-db {
    proxy_pass http://127.0.0.1:11029;
    proxy_pass_header Set-Cookie;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

  location ^~ /monitoring-db/druid {
    proxy_pass http://127.0.0.1:11029;
  }
  
  location  ~ ^/monitoring-db.*\.(html|css|js|jpg|jpeg|gif|png|ico|pdf|txt)$ {
    root /usr/local/plisp/litongjava-jfinal-monitoring-db-1.0/static;
  }

1.1.7测试访问

http://ip/monitoring-db

默认用户名和密码是admin/admin

Comments ( 2 )

Sign in for post a comment

About

检测数据库连接,检测失败,发送邮件 spread retract
Cancel

Releases (1)

All

Contributors

All

Activities

load more
can not load any more
Java
1
https://gitee.com/litongjava_admin/litongjava-jfinal-monitoring-db.git
git@gitee.com:litongjava_admin/litongjava-jfinal-monitoring-db.git
litongjava_admin
litongjava-jfinal-monitoring-db
litongjava-jfinal-monitoring-db
master

Search