数据库实例连通检测(mysql/redis)

Author:skatexg

Time:2021/07/27

数据库实例连通检测

1.使用场景:

存在问题:研发同学经常用很长时间排查数据库连通性问题,或向dba寻求帮助时,需要反复沟通确认问题,才能解决,影响工作效率

目的:希望研发同学使用此工具可以检查从应用服务是否可以连接到数据库实例,提高研发同学排障的效率


2.下载与安装

# wget https://download.csdn.net/download/wyzxg/20562565
# yum install db-connect-check-1.0.1-gld.dba.x86_64.rpm


3.命令用法:

# db_connect_check.sh -H
Usage:
sh db_conn_check.sh -h host [-u user] -P port -p password -t type

Description:
   host: the address of database instance.
   user: the username of database instance.
   port: the port of database instance.
   password: the password of database instance.
   type: the type of database,eg:redis or mysql.
   

4.样例

检查mysql实例的连通性  
 
# db_connect_check.sh -h 10.125.68.210 -u user -P 3306 -p pwd -t mysql                           
############### MySQL begin check 10.125.68.210:3306 ########

network check:          success
port check:             fail[Contact DBA]
db login check:         fail[user or password is wrong]

############### End check ################################


检查mysql实例的连通性 

# db_connect_check.sh -h 10.125.68.89 -P 6379 -p 3se66S1 -t redis            
############### Redis begin check 10.125.68.89:6379 ########

network check:          success
port check:             success
db login check:         fail[user or password is wrong]

############### End check#################################

-------end-------

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值