The first step: check the linux system version
cat /etc/centos-release
The second step: open liunx port number
After CentOS was upgraded to 7, it was found that iptables could not be used to control the port of Linuxs. After baidu, it was discovered that CentOS 7 used firewalld to replace the original iptables. The following records how to use firewalld to open Linux ports:
Open port
[root@centos7 ~]# firewall-cmd --zone=public --add-port=8004/tcp --permanent
Query whether port 80 is open:
[root@centos7 ~]# firewall-cmd --query-port=8004/tcp
Restart the firewall:
[root@centos7 ~]# firewall-cmd --reload
Query which ports are open:
[root@centos7 ~]# firewall-cmd --list-port
Step 3: Open port 8004 on Alibaba Cloud
1. Enter the console and click ECS
2. Click Cloud Server
3. Information about your server appears, click More
5. Click Configure Rules
5. Click Configure Rules
6. Add Security Group Policy
7. Open the port number. I opened four port numbers from 8001 to 8004
Get it done