Currently, ApsaraDB for Memcache is accessible by ECS intranet. If you must access ApsaraDB for Memcache through the Internet, you must create port mapping through netsh on the ECS Windows server.
Log on to the ECS Windows server, and run the following command in CMD.
netsh interface portproxy add v4tov4 listenaddress=ECS server private IP address listenport=11211 connectaddress=ApsaraDB for Memcache connection address connectport=11211
To view all port forwarding rules on the server, run the following command:
netsh interface portproxy show all
Verify and test the mappings after settings are completed.
Connect to the ECS Windows server locally through the telnet and write data for query and verification. If the IP address of the ECS Windows server is 18.104.22.168, that is
telnet 22.214.171.124 11211.
With these steps, your local PC or server can be connected to the ECS Windows 11211 port over the Internet and access Alibaba Cloud ApsaraDB for Memcache.
Note: Because portproxy is provided by the official Microsoft team, and is not open-source, if you have any questions during configuration and usage, see the netsh portproxy usage instructions or consult with Microsoft. Also consider other alternatives, such as configuring proxy mappings through portmap.
- After finishing related operations, you can run
netsh interface portproxy delete v4tov4 listenaddress=ECS private IP address listenport=11211to delete the public network forwarding rule.
Currently, Alibaba Cloud ApsaraDB for Memcache is accessible by ECS intranet. If you must access ApsaraDB for Memcache through the Internet, you must install rinetd on the ECS Linux server for forwarding.
Install rinetd on the ECS Linux.
wget http://www.boutell.com/rinetd/http/rinetd.tar.gz&&tar -xvf rinetd.tar.gz&&cd rinetd
sed -i 's/65536/65535/g' rinetd.c (Modify the port range. Otherwise an error will be reported)
mkdir /usr/man&&make&&make install
Note: The download address of the rinetd installer may not be available. You can search for the installer on your own for downloading and usage.
Create the configuration file.
Enter the following content.
0.0.0.0 11211 [Memcache connection address] 11211
rinetdcommand to start rinetd.
Note: You can set it to auto start through
echo rinetd >>/etc/rc.local. You can use
pkill rinetdto end the process.
Test and verify.
Connect to the ECS Linux server locally through telnet for data write and query validation. For example, if the IP address of the server with rinetd installed is 126.96.36.199, that is
telnet 188.8.131.52 11211.
Following these steps, your local PC or server can be connected to the ECS Linux 11211 port over the Internet and access Alibaba Cloud ApsaraDB for Memcache.
Note: Since rinetd is open-source software, if you have any questions during the usage, you can see its official documentation or contact the official side of rinetd for confirmation.