Open the corresponding ports in the security policy of iptables and cloud host
By the way, the IP bound to mongodb is set to 0.0.0.0
Be sure to set a password. Many people do not set a password or set a very weak password, which poses a huge security risk. Hackers will scan the entire network for mogodb ports, and many people have fallen victim to this. It has been reported in the news
So it is best not to enable external network access to the database. If you want to do distributed, it is best to only enable intranet access to the cloud host
Your application should access the database through the server program and provide external business APIs. Do not access the remote database directly from the client
Open the corresponding ports in the security policy of iptables and cloud host
By the way, the IP bound to mongodb is set to 0.0.0.0
Be sure to set a password. Many people do not set a password or set a very weak password, which poses a huge security risk. Hackers will scan the entire network for mogodb ports, and many people have fallen victim to this. It has been reported in the news
So it is best not to enable external network access to the database. If you want to do distributed, it is best to only enable intranet access to the cloud host
Your application should access the database through the server program and provide external business APIs. Do not access the remote database directly from the client
Just open the mongodb port so that it can be accessed by the outside world