linux暴露端口可以被外部訪問,把端口號換成要暴露的端口:
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
Centos 7 開啟端口
CentOS 7 默認沒有使用iptables,所以通過編輯iptables的配置文件來開啟80端口是不可以的,CentOS 7 采用了 firewalld 防火牆
查詢是否開啟80端口則:firewall-cmd --query-port=80/tcp
開啟80端口:firewall-cmd --add-port=80/tcp
啟動mysql:systemctl start mysqld
InfluxDb
配置文件:/etc/influxdb/influxdb.conf
操作:
1、啟動InfluxDb:systemctl start influxdb 或者:influxd 后台啟動:nohup ./influxd
2、查看InfluxDb狀態:systemctl status influxdb
3、停止InfluxDb:systemctl stop influxdb
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT