How to back up remote data using mongodump?

  mongodb, question

Mongodump-umongodbuser-pxx-dbh remote IP address-port27017-oxx
Command as above, back up the remote database with the error prompt of failed: errorconnecting to dbserver: noreachable servers
It is correct to change -h to local ip, so what should I do to back up remote mongodb data? ?

mongodump -h x.x.x.x –port xxx -u xxx –password xxx

./mongodump –help

–help displays help information
-v [-verbose] prints out more information, such as time, etc. -vvvvv
–version Print Version Information
-h [-host] arg specifies the connected mongodb host, set to /s1,s2 when copying the set
-portarg specifies the mongodb port number or-hosthostname: port
–ipv6 Enable Supports IPv6 support
-u [-username] arg username
-p [-password] arg password
–authenticationDatabase arg user source (defaults to dbname)
–authenticationMechanism arg (=MONGODB-CR)
authentication mechanism
-dbpatharg directly accesses mongod’s database files instead of connecting to mongodb servers. You need to lock the data directory. If mongod is currently accessing the same path, it will not be available. In other words, you cannot use-dbpath when mongod is running, and you can specify-dbpath directly when mongod is not running.
–directoryperdb has a separate directory for each db, and dbpath needs to be specified
–journal enables journaling and dbpath needs to be specified
-d [-db] arg specifies the database
-c [-collection] arg specifies a collection
–o [–out] arg (=dump) specifies the output directory, “-“means standard output
-q [-query] argjson query
–oplog uses oplog to produce point-in-time snapshots
–repair attempted to recover the crashed database
–forceTableScan forces table scanning without using $snapshot