sunshine2016

需求: 模拟数据库挂掉,服务正常但访问数据库报错,恢复数据库端口后,服务是否能正常访问数据库

步骤:首先,断掉端口号5432,测试服务运行情况;其次,开启端口号5432,测试服务运行情况;

具体操作:

1,断掉端口号

    a,登录服务器

  b,查看端口号连接情况:telnet localhost 5432

  c,断开端口号:sudo iptables -A INPUT -p tcp --dport 5432 -j DROP

          sudo iptables -A OUTPUT -p tcp --dport 5432 -j DROP

   d, 查看端口号连接情况:telnet localhost 5432

2,开启端口号

  a,查看规则列表:sudo iptables -L -n

  b,删除drop规则:sudo iptables -D INPUT 1

              sudo iptables -D OUTPUT 1

  c,查看规则是否删除:sudo iptables -L -n

  d,查看端口号连接情况:telnet localhost 5432

 

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-12-28
  • 2021-12-28
  • 2022-01-07
  • 2021-09-17
  • 2021-10-16
  • 2021-12-05
猜你喜欢
  • 2021-12-05
  • 2021-12-05
  • 2021-11-04
  • 2021-12-01
  • 2021-11-30
  • 2021-12-09
  • 2021-12-05
相关资源
相似解决方案