All Products
Document Center

ECS Linux

Last Updated: Sep 29, 2017

Currently, ApsaraDB for MongoDB is only accessible through ECS intranet. If you want to locally access ApsaraDB for MongoDB by the public network, you can install rinetd on the ECS Linux server for port forwarding.


  1. Install rinetd on the ECS Linux server.

    1. wget -xvf rinetd.tar.gz&&cd rinetd
    2. sed -i 's/65536/65535/g' rinetd.c (Modify the port range)
    3. mkdir /usr/man&&make&&make install
  2. Open the configuration file.

    1. vi /etc/rinetd.conf
  3. Add the following content to the configuration file.

    1. 3717 MongoDB connection address 3717
    2. logfile /var/log/rinetd.log
  4. Run the following command to start rinetd.

    1. rinetd

    Note: Run echo rinetd >>/etc/rc.local to enable auto-launch, or run pkill rinetd to kill the process.

  5. Perform a verification test.

    Run the mongo shell command locally to connect to the ECS Linux server and verify using logon authentication. For example, if the IP address of the server with rinetd installed is, you can run the following command.

    1. mongo --host -u root -p password --authenticationDatabase admin

    After you complete the preceding steps, use a local PC or server to connect to Port 3717 of the ECS Linux server to access ApsaraDB for MongoDB through the public network.

    Note: You can use the preceding scheme to test and use rinetd. As rinetd is an open source software, if you have any issues, see the rinetd documentation or consult with rinetd engineers.