I'm wondering if anyone has had this error when trying to initialise their mongo database?
I downloaded the MongoDB release and tried to run it in the command line and got this error back.
>init-db.exe -data=data.json
2020/06/27 23:23:58 Database mongodb 111
2020/06/27 23:23:58 Failed to init DB adapter: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [] }
My server is localhost:27017.
// MongoDB configuration.
"mongodb": {
// Address(es) of MongoDB node(s): either a string or an array of strings.
"addresses": "localhost:27017",
// Name of the main database.
"database": "tinode",
// Name of replica set of mongodb instance. Remove this line to use a standalone instance.
// If replica_set is disabled, transactions will be disabled as well.
"replica_set": "rs0",
// Authentication options. Uncomment if auth is configured on your MongoDB.
// "auth_source" is name of database that has the collection with the user credentials.
// Default is 'admin' if not set:
// "auth_source": "admin",
// Username:
// "username": "tinode",
// Password:
// "password": "tinode",
// Driver's TLS configuration. Uncomment to enable TLS.
//"tls": true,
// Path to the client certificate. Optional.
//"tls_cert_file": "/path/to/cert_file",
// Path to private key. Optional.
//"tls_private_key": "/path/to/private_key",
// Specifies whether or not certificates and hostnames received from the server should be validated.
// Not recommended to enable in production. Default is false.
//"tls_skip_verify": false
}
Any help is appreciated.
Thanks all.