在数据库系统上打开端口

您可以使用以下步骤打开数据库系统上的端口。

根据需要在数据库系统上打开以下端口:

有关关键防火墙规则的重要信息,请参见 Security Rules for the DB System 中的基本防火墙规则。

过程

  1. 通过 SSH 连接到数据库系统。

    ssh -i <private_key_path> opc@<db_system_ip_address>
  2. 以 opc 身份登录,然后向 root 用户执行 sudo。

    login as: opc
    sudo su -
  3. 将 iptables 的副本保存为备份。

    iptables-save > /tmp/iptables.orig

    (如有必要,可以使用命令 iptables-restore < /tmp/iptables.orig 恢复原始文件。)

  4. 向 iptables 动态添加规则以允许控制台端口上的入站流量,如以下示例所示。根据需要更改端口号和注释。

    iptables -I INPUT 8 -p tcp -m state --state NEW -m tcp --dport 1158 -j ACCEPT -m comment
    --comment "Required for Enterprise Manager Database Control."
  5. 确保已添加规则。

    service iptables status
  6. 将更新后的文件保存到 /etc/sysconfig/iptables。

    /sbin/service iptables save

    更改将立即生效,并在重新引导节点时保持有效。

  7. 按 Update the Security List for the DB System 中所述更新数据库系统的安全列表。