You don't know I can really cryDetailed tutorial on cloud server open port is here |
Preface
1. Understanding of common cloud server ports
● Cloud server port generally refers to the port in the TCP/IP protocol. The port number ranges from 0 to 65535, such as port 80 for browsing web services , port 21 for FTP services , etc.
● When a computer starts an accessible program, it must open at least one port number to allow external computers to access it. We can think of a cloud host that does not have a port number open as a sealed room. A sealed room cannot accept access from the outside world, so when the system opens an accessible program, it naturally needs to open a window in the room. To accept external access, this window is what we often call the port.
● When we make a request, whether the other party's server port is open determines whether we can complete the access. A server has many ports, different ports have different functions, and different services use different ports. The following introduces some commonly used server ports as a way to understand the services corresponding to the port numbers.
2. Why should we open the cloud server port?
● Does the cloud server port need to be opened? In line with the principle of server security, the ports on the cloud server should not be opened for non-essential services. If there are relevant business needs, it can be turned on. If not, it is best not to turn it on.
● For example: I deployed a MySQL service on Tencent Cloud Server. After MySQL is started successfully, Navicat under Windows cannot connect? Remember that there is no open port on the cloud server, which will lead to the above connection failure problem, so the way to solve this problem is to open the corresponding port on the cloud server; if you still cannot access the port after opening it, you can try opening it After opening the port, restart the server.
3. Practical tutorial on opening cloud server ports
1. Install docker command
#安装docker命令:
yum update # 更新yum源
yum install -y yum-utils #安装必要的包,提供yum-config-manager,可用来管理yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #配置国内镜像源
yum install -y docker-ce docker-ce-cli containerd.io # 安装docker
# 验证docker是否安装成功
docker # 提示Usage: docker [OPTIONS] COMMAND...表示安装成功
# 启动docker服务器
systemctl start docker
2. Pull the image mysql:5.7 from Docker Hub
3. Run the image and deploy the MySQL environment
4. Navicat connects to MySQL service
5. Open cloud service port
Log in to the server, enter the console, find the server--firewall--add rules
6. Navicat connects to the MySQL service again