Is a meteor using the Mongolian field?

How can I check if a meteor is using my mongo splash? I have a mango cluster and a set of two envs for my meteor.

MONGO_URL=mongodb://mongo/app?replicaSet=rs0
MONGO_OPLOG_URL=mongodb://mongo/local?authSource=app

How to check if selection log is really used. A meteor may back down to request a poll that is very inefficient, but I would like to see if it works correctly with oplog.

Any ideas?

+4
source share
3 answers

Quoting the corresponding bits from Meteor OplogObserveDriverdocs :

How to find out if your queries are using OplogObserveDriver

At the moment we have only a rough way to tell how many calls observChanges uses the OplogObserveDriver, and not what calls.

facts, Meteor, Meteor. meteor add facts {{> serverFacts}} . autopublish, Meteor . autopublish, Meteor, , Facts.setUserIdFilter ; :

Facts.setUserIdFilter(function (userId) {
  var user = Meteor.users.findOne(userId);
  return user && user.admin;
});

( Facts.setUserIdFilter(function () { return true; }); !)

. ; , , - --oplog - mongo-livingata. -- , watchChanges OplogObserveDriver!

+4

Kadira APM , , oplogs, "Live Queries" "Oplog notifications".

, oplogs , ( ). oplogs , .

apm oplog chart ninjapixel meteor

0

, user my_database oplog_user local. URI test-shard (, 3 test-shard-[0-2]):

MONGO_URL="mongodb://user:PASS@test-shard-0.mongodb.net:27017,test-shard-1.mongodb.net:27017,test-shard-2.mongodb.net:27017/my_database?ssl=true&replicaSet=test-shard&authSource=admin"
MONGO_OPLOG_URL="mongodb://oplog_user:PASS@test-shard-0.mongodb.net:27017,test-shard-1.mongodb.net:27017,test-shard-2.mongodb.net:27017/local?ssl=true&replicaSet=test-shard&authSource=admin"

MongoDB Atlas ssl=true, admin. my_database, authsource=admin MONGO_URL authsource=my_database MONGO_OPLOG_URL. . .

MongoDB 3.6 Mongo node 3.0+ DNS-, MongoDB Atlas, :

MONGO_URL="mongodb+srv://user:PASS@foo.mongodb.net/my_database"
MONGO_OPLOG_URL="mongodb+srv://oplog_user:PASS@foo.mongodb.net/local"

The link above explains how this notation fills the arguments ssl, replicaSetand authSource. This is much better than the long lines above, and also means that you can scale your replica tuned up and down without having to reconfigure anything.

As mentioned in hwillson, use the packages facts-uiand facts-base(earlier facts) to see if there is any in your application oplogObserveDriver. If they are all pollingObserveDriver, then oplog is not configured correctly.

0
source

Source: https://habr.com/ru/post/1651581/


All Articles