Со следующими .mongorc.js:
rs.slaveOk();
function startRS() {
config = {_id: 'rs', members: [{_id: 0, host: 'localhost:27017', priority: 1}, {_id: 1, host: 'localhost:27016', priority: 0}]};
rs.initiate(config);
}
И следующий скрипт запуска:
#!/bin/bash
mkdir /data/db/rs{0,1} >/dev/null 2>&1
/opt/mongo-db/bin/mongod --replSet rs --port 27016 --dbpath /data/db/rs1 &
/opt/mongo-db/bin/mongod --replSet rs --port 27017 --dbpath /data/db/rs0 &
/opt/mongo-db/bin/mongo --eval "startRS()"
Монго запускается все нормально. Но когда я пытаюсь запустить mongorestore как
$ /opt/mongo-db/bin/mongorestore --drop dump/
зависает при непрерывной записи
2018-06-29T19:35:47.661+0200 [########################] ardoq-common.model.versions 753KB/753KB (100.0%)
2018-06-29T19:35:47.661+0200 [#####...................] iansneworg.component.versions 456KB/1.99MB (22.4%)
2018-06-29T19:35:47.661+0200 [........................] home.component.versions 447KB/12.9MB (3.4%)
2018-06-29T19:35:47.661+0200 [#.......................] piedpiper.component.versions 593KB/12.4MB (4.7%)
2018-06-29T19:35:47.661+0200
2018-06-29T19:35:50.662+0200 [########################] ardoq-common.model.versions 753KB/753KB (100.0%)
2018-06-29T19:35:50.662+0200 [#####...................] iansneworg.component.versions 456KB/1.99MB (22.4%)
2018-06-29T19:35:50.662+0200 [........................] home.component.versions 447KB/12.9MB (3.4%)
2018-06-29T19:35:50.662+0200 [#.......................] piedpiper.component.versions 593KB/12.4MB (4.7%)
2018-06-29T19:35:50.662+0200
2018-06-29T19:35:53.664+0200 [########################] ardoq-common.model.versions 753KB/753KB (100.0%)
2018-06-29T19:35:53.664+0200 [#####...................] iansneworg.component.versions 456KB/1.99MB (22.4%)
2018-06-29T19:35:53.664+0200 [........................] home.component.versions 447KB/12.9MB (3.4%)
2018-06-29T19:35:53.664+0200 [#.......................] piedpiper.component.versions 593KB/12.4MB (4.7%)
2018-06-29T19:35:53.664+0200
Пока логи mongodb
2018-06-29T19:37:57.368+0200 I NETWORK [listener] connection accepted from 127.0.0.1:62632 #60 (11 connections now open)
2018-06-29T19:37:57.372+0200 I NETWORK [listener] connection accepted from 127.0.0.1:62634 #10 (4 connections now open)
2018-06-29T19:37:57.377+0200 I COMMAND [conn60] CMD: drop home.component.versions
2018-06-29T19:37:57.377+0200 I STORAGE [conn60] dropCollection: home.component.versions (623af0a3-ee8d-4b8a-9e28-349bd1094b32) - renaming to drop-pending collection: home.system.drop.1530293877i1t5.component.versions with drop optime { ts: Timestamp(1530293877, 1), t: 5 }
2018-06-29T19:37:57.379+0200 I NETWORK [listener] connection accepted from 127.0.0.1:62636 #61 (12 connections now open)
2018-06-29T19:37:57.379+0200 I STORAGE [conn60] createCollection: home.component.versions with generated UUID: f5cb88f9-df22-4990-9ef8-cdd689892b50
2018-06-29T19:37:57.380+0200 I COMMAND [repl writer worker 9] CMD: drop home.component.versions
2018-06-29T19:37:57.380+0200 I STORAGE [repl writer worker 9] dropCollection: home.component.versions (623af0a3-ee8d-4b8a-9e28-349bd1094b32) - renaming to drop-pending collection: home.system.drop.1530293877i1t5.component.versions with drop optime { ts: Timestamp(1530293877, 1), t: 5 }
2018-06-29T19:37:57.382+0200 I NETWORK [listener] connection accepted from 127.0.0.1:62638 #62 (13 connections now open)
2018-06-29T19:37:57.383+0200 I COMMAND [conn61] CMD: drop piedpiper.component.versions
2018-06-29T19:37:57.383+0200 I STORAGE [conn61] dropCollection: piedpiper.component.versions (1eaf6561-eea5-414d-80d2-b914f5110559) - renaming to drop-pending collection: piedpiper.system.drop.1530293877i3t5.component.versions with drop optime { ts: Timestamp(1530293877, 3), t: 5 }
2018-06-29T19:37:57.384+0200 I STORAGE [repl writer worker 0] createCollection: home.component.versions with provided UUID: f5cb88f9-df22-4990-9ef8-cdd689892b50
Это на MacOS High Sierra с mongodb-osx-x86_64-enterprise-3.6.5
У меня есть такая точная (вероятно, не точная, поскольку она работает) установка, работающая на другом Mac, также с MacOS High Sierra, но, вероятно, с mongodb-3.6.4.
Какие-нибудь советы?