Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb主从切换 #551

Open
xueyuchen opened this issue Jan 20, 2017 · 0 comments
Open

mongodb主从切换 #551

xueyuchen opened this issue Jan 20, 2017 · 0 comments

Comments

@xueyuchen
Copy link

DESC

我们使用的是阿里云mongodb,需要配置两个主从ip(例如下面192.168.10.2,192.168.10.3)
问题:第一个节点(192.168.10.2)挂掉之后不会自动切换到第二个节点(192.168.10.3)

db: {
    type: 'mongo',
    log_sql: true,
    log_connect: true,
    adapter: {
      mongo: {
        host: ['192.168.10.2','192.168.10.3'],
        port: ['3717'],
        database: 'dev',
        prefix: '',
        user: 'root',
        password: '123456',
        options: {
          authSource: "admin"
        },
        server: {
          poolSize: 1
        }
      }
    }
  }

ENV

Platform:
centos6
Node.js Version:
v6.3.1
ThinkJS Version:
v2.2.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant