I am trying to set up MongoDB OpLog tailing on newly commissioned server.
Using Meteor 1.2.1, MongoDB 3.2 under Ubuntu 14.
I have configured my MongoDB install to run in master mode, and when I start MongoDB I see in its log:
2015-12-20T12:52:34.069+0000 I CONTROL [initandlisten] target_arch: x86_64
2015-12-20T12:52:34.069+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", master: true, net: { bindIp: "127.0.0.1", port: 27017 }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2015-12-20T12:52:34.095+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2015-12-20T12:52:35.202+0000 I STORAGE [initandlisten] Starting WiredTigerRecordStoreThread local.oplog.$main
2015-12-20T12:52:35.203+0000 I STORAGE [initandlisten] The size storer reports that the oplog contains 122 records totaling to 7867 bytes
2015-12-20T12:52:35.203+0000 I STORAGE [initandlisten] Scanning the oplog to determine where to place markers for truncation
I have created a user for oplog access, and I can connect manually:
client@hh-web1:/var/log/mongodb# mongo 127.0.0.1:27017/local -u oplogger -p oplogger --authenticationDatabase admin
MongoDB shell version: 3.2.0
connecting to: 127.0.0.1:27017/local
> show collections
me
oplog.$main
startup_log
I start meteor as follows:
ROOT_URL=https://foo.com/ MONGO_URL=mongodb://127.0.0.1:27017/foo MONGO_OPLOG_URL=mongodb://oplogger:oplogger@127.0.0.1:27017/local?authSource=admin meteor --production --settings server/settings.json
As the server starts I see the connections open in mongodb.log, including:
2015-12-20T13:20:33.589+0000 I ACCESS [conn40] Successfully authenticated as principal oplogger on admin
…but still Meteor complains and will not start:
W20151220-13:20:33.834(0)? (STDERR) /home/shing/.meteor/packages/meteor-tool/.1.1.10.ki0ccv++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20151220-13:20:33.834(0)? (STDERR) throw(ex);
W20151220-13:20:33.835(0)? (STDERR) ^
W20151220-13:20:33.835(0)? (STDERR) Error: $MONGO_OPLOG_URL must be set to the 'local' database of a Mongo replica set
W20151220-13:20:33.835(0)? (STDERR) at Error (<anonymous>)
W20151220-13:20:33.835(0)? (STDERR) at [object Object]._.extend._startTailing (packages/mongo/oplog_tailing.js:216:1)
What am I doing wrong?