cayasso / mongo-oplog

Watch mongodb oplog in a simple way
381 stars 91 forks source link

make test failed. #48

Closed nkarthik closed 6 years ago

nkarthik commented 7 years ago

[root@stlrx2540m1-68 mongo-oplog-master]# mongo --host stlrx2540m1-68 --port 27021 MongoDB shell version: 3.2.10 connecting to: stlrx2540m1-68:27021/test Server has startup warnings: Wed Mar 1 10:46:59.119 I CONTROL [initandlisten] WARNING: You are running this process as the root user, which is not recommended. Wed Mar 1 10:46:59.119 I CONTROL [initandlisten] Wed Mar 1 10:46:59.120 I CONTROL [initandlisten] Wed Mar 1 10:46:59.120 I CONTROL [initandlisten] WARNING: You are running on a NUMA machine. Wed Mar 1 10:46:59.120 I CONTROL [initandlisten] We suggest launching mongod like this to avoid performance problems: Wed Mar 1 10:46:59.120 I CONTROL [initandlisten] numactl --interleave=all mongod [other options] Wed Mar 1 10:46:59.120 I CONTROL [initandlisten]

var config = {_id: "test", members: [{_id: 0, host: "127.0.0.1:27021"}]} rs.initiate(config) { "ok" : 1 } test:OTHER> test:PRIMARY> test:PRIMARY> test:PRIMARY> rs.status(); { "set" : "test", "date" : ISODate("2017-03-01T15:49:02.428Z"), "myState" : 1, "term" : NumberLong(1), "heartbeatIntervalMillis" : NumberLong(2000), "members" : [ { "_id" : 0, "name" : "127.0.0.1:27021", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 124, "optime" : { "ts" : Timestamp(1488383324, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2017-03-01T15:48:44Z"), "infoMessage" : "could not find member to sync from", "electionTime" : Timestamp(1488383323, 2), "electionDate" : ISODate("2017-03-01T15:48:43Z"), "configVersion" : 1, "self" : true } ], "ok" : 1 } test:PRIMARY> bye [root@stlrx2540m1-68 mongo-oplog-master]# root@stlrx2540m1-68 mongo-oplog]# unzip mongo-oplog-master.zip Archive: mongo-oplog-master.zip bee06b72072f20e9a6519935b98b9683fb7b3c8a creating: mongo-oplog-master/ inflating: mongo-oplog-master/.babelrc inflating: mongo-oplog-master/.gitignore inflating: mongo-oplog-master/.npmignore inflating: mongo-oplog-master/.travis.yml inflating: mongo-oplog-master/README.md inflating: mongo-oplog-master/UPGRADE.md inflating: mongo-oplog-master/index.js inflating: mongo-oplog-master/package.json creating: mongo-oplog-master/src/ inflating: mongo-oplog-master/src/filter.js inflating: mongo-oplog-master/src/index.d.ts inflating: mongo-oplog-master/src/index.js inflating: mongo-oplog-master/src/stream.js creating: mongo-oplog-master/test/ inflating: mongo-oplog-master/test/index.js inflating: mongo-oplog-master/test/mocha.opts [root@stlrx2540m1-68 mongo-oplog]# cd mongo-oplog-master [root@stlrx2540m1-68 mongo-oplog-master]# npm install

pre-commit@1.2.0 install /usr/src/mongo-oplog/mongo-oplog-master/node_modules/pre-commit node install.js

spawn-sync@1.0.15 postinstall /usr/src/mongo-oplog/mongo-oplog-master/node_modules/spawn-sync node postinstall

npm WARN lifecycle mongo-oplog@2.0.2~prepublish: cannot run in wd %s %s (wd=%s) mongo-oplog@2.0.2 npm run build /usr/src/mongo-oplog/mongo-oplog-master mongo-oplog@2.0.2 /usr/src/mongo-oplog/mongo-oplog-master

(removed command outputs due to log size)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN babel-loader@6.3.2 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed. [root@stlrx2540m1-68 mongo-oplog-master]# make test make: Nothing to be done for `test'. [root@stlrx2540m1-68 mongo-oplog-master]# npm install fsevents@1.0.0 npm ERR! Linux 2.6.32-642.3.1.el6.x86_64 npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "fsevents@1.0.0" npm ERR! node v6.10.0 npm ERR! npm v3.10.10 npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported platform for fsevents@1.0.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: linux npm ERR! notsup Actual Arch: x64

npm ERR! Please include the following file with any support request: npm ERR! /usr/src/mongo-oplog/mongo-oplog-master/npm-debug.log [root@stlrx2540m1-68 mongo-oplog-master]# less /usr/src/mongo-oplog/mongo-oplog-master/npm-debug.log [root@stlrx2540m1-68 mongo-oplog-master]#

if anyone successfully installed and tested mongo-oplog, please share your steps and guide me . I want to run the tailing of oplog.

regards, Nagalingam

usamaB commented 7 years ago

Im also getting an error on nmp install command. scr doesn't exist and others. See attached file. I really need this to work. Npm install Error.txt

EDIT: I did sudo npm install and the error was gone but now on the "npm run test" it gives an error

mongo-oplog@2.0.2 test /home/sam/Downloads/node_modules/mongo-oplog xo && mocha index.js:1:1 ✖ 1:1 Expected empty line after require statement not followed by another require. import/newline-after-import ✖ 1:27 Unable to resolve path to module ./lib. import/no-unresolved

2 errors

cayasso commented 7 years ago

You need to run npm run build before npm run test BTW. May I ask why are you installing mongo-oplog from the source instead of in a project? Typically you will only add it to your project and setup your replica set and done.

usamaB commented 7 years ago

What do you mean by source instead of a proj. I want to test this functionality for a proj (ATM I have nothing. Just some collections). I have the replica setup in place. I want to use the event trigger-like functionality. Do something on oplog events. The install and run build commands are giving the same error. Src doesn't exist. I'm following the ReadMe.md.