作者:小李子 | 来源:互联网 | 2023-08-19 10:29
If your replicas uses different ports for each server, there is no way of specifying this right now.
As stated in the documentation:
1 2 3 4 5 6 7 8 9
| 'mongodb' => array(
'driver' => 'mongodb',
'host' => array('server1', 'server2'),
'port' => 27017,
'username' => 'username',
'password' => 'password',
'database' => 'database',
'options' => array('replicaSet' => 'replicaSetName')
), |
Instead I think you should be able to specific a port for each host, like so:
1 2 3 4 5 6 7 8 9
| 'mongodb' => array(
'driver' => 'mongodb',
'host' => array('server1', 'server2'),
'port' => array(27017, 27018),
'username' => 'username',
'password' => 'password',
'database' => 'database',
'options' => array('replicaSet' => 'replicaSetName')
), |
which should result in a path which respects the ports.
该提问来源于开源项目:jenssegers/laravel-mongodb
Thanks so much J/S! I just updated and it's working.