oneinstackはリモートアクセスを設定し、外の世界へのポートを開きます

mysqlデータベース、redisデータベースなどでリモートアクセスを有効にする必要がある場合は、次の手順に従います。

たとえば、次のとおりです。

 1. iptables 3306ポートを開く

iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
service iptables save #保存iptables规则

 2. iptables 6379ポートを開く

iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT
service iptables save #保存iptables规则

-----------------------------------------------------------------------------------
如果出现以下二种情况
iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT   指令报错 :iptables: Index of insertion too big.
service iptables save   指令报错 : The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

 解決策:

  1.サービスをインストールまたは更新します。yuminstall iptables-services 

  2. iptables systemctl enable iptables 

  3. iptable systemctl start iptablesを開きます 

  4.最後にservice iptables saveを実行します

  5.サービスを再起動しますiptables restart

 

   最後に、サーバーのファイアウォールポリシーにも対応するポートを追加する必要があることに注意してください。

 

おすすめ

転載: www.cnblogs.com/SeaWxx/p/12698462.html
おすすめ