I have problem to connect the web app to replica set setup. e are using Mongodb to login our users and manage our app. On web app we are using PHP driver and mongoDB is setup with PSA(primary-secondary-arbiter, where each db is on different server). When both primary and secondary database are up the response and visual for the app are great . When I shut down one of the server, the response are slow and the app did not show correctly ( the connection string is setup for replica set). When I change the connection string from replica set to standalone (for active DB) the app respond and show correctly.
Am I something missing on configuration on mongoDB replica set? Or do I need something add to the PHP? here is the PHP conn.
$mongo_client = new MongoDB\Client($config->connectionString);
$db = $mongo_client->selectDatabase($config->databaseName);
connectionString - "mongodb://user:passs@firstserver,secondserverI?replicaSet=maintest&readPreference=nearest