Comments (18)
@menelike You can enable oplog after the initial mup setup
and mup deploy
runs, which makes sure the containers are all already set up with proper linkings.
To do this, after your remote server is set up with your app + mongo containers, do:
- Add
replSet=meteor
as a new line in/opt/mongodb/mongodb.conf
(this is mapped to themongodb
container at/mongodb.conf
and used by the mongo daemon running inside the container). docker restart mongodb
docker exec -it mongodb mongo
and run the following code to initialise replica set:rs.initiate({ _id: 'meteor', members: [{ _id: 0, host: '127.0.0.1:27017' }] })
- Now you can safely add in the
meteor.env.MONGO_OPLOG_URL
key in yourmup.js
and domup deploy
to update your app without your oplog-enabled container being altered
We were using this little work-around to get oplog working in mupx
and still works fine. You should only need to do this once. If somehow your mongodb
container gets removed, you'll need to enable replica set again on your new one.
Also, this only sets up a single-node replica set, which allows oplog to be used. Theoretically you could set up more mongo nodes and then point to them from this mup-created container in step 3. Haven't tried though.
Set your meteor.env.MONGO_URL
to mongodb://mongodb:27017/$APP_NAME
, where APP_NAME is whatever you put in meteor.name
, and meteor.env.MONGO_OPLOG_URL
to mongodb://mongodb:27017/local
.
from meteor-up.
Just setup a mongodb docker container yourself with your own config. Then pass the URL to meteor app.
from meteor-up.
Are you working on this? Or do you want some help, because I need this for a client so if we had automatic oplog tailing in the mongodb docker using mup, all the deployments would be amazingly less straining on the CPU.
from meteor-up.
@arunoda it doesn't seem like this line is doing anything actually, have you implemented this? Or is this just a marketing scheme? ;) https://github.com/kadirahq/meteor-up/blob/master/src/modules/default/template/mup.js.sample#L24
from meteor-up.
No, We currently use a default mongodb config file. PRs are welcome :)
from meteor-up.
alright, thx, I'll see what I can do
from meteor-up.
@timbrandin @madushan1000 I am also running into this issue. Deployment fails when you specify MONGO_URL
and MONGO_OPLOG_URL
in the mup.json
file, i.e.
"env": {
"ROOT_URL": "https://xx.xx.xxx.xx",
"MONGO_URL": "mongodb://staging:27017,staging:27018,staging:27019/staging?replicaSet=rs0",
"MONGO_OPLOG_URL": "mongodb://staging:27017,staging:27018,staging:27019/local?authSource=admin",
"MAIL_URL": "smtp://localhost:25",
"CLUSTER_WORKERS_COUNT": "auto",
"KADIRA_PROFILE_LOCALLY": 1
},
staging
is the hostname of the Linux server I am deploying to (I've tried replacing this with the server's IP address to no avail).
The replica set status is healthy:
{
"set" : "rs0",
"date" : ISODate("2016-04-12T10:23:45.887Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "staging:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 41791,
"optime" : Timestamp(1460455377, 2),
"optimeDate" : ISODate("2016-04-12T10:02:57Z"),
"electionTime" : Timestamp(1460414921, 1),
"electionDate" : ISODate("2016-04-11T22:48:41Z"),
"configVersion" : 1,
"self" : true
},
{
"_id" : 1,
"name" : "staging:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 41706,
"optime" : Timestamp(1460455377, 2),
"optimeDate" : ISODate("2016-04-12T10:02:57Z"),
"lastHeartbeat" : ISODate("2016-04-12T10:23:45.670Z"),
"lastHeartbeatRecv" : ISODate("2016-04-12T10:23:43.927Z"),
"pingMs" : 0,
"syncingTo" : "staging:27017",
"configVersion" : 1
},
{
"_id" : 2,
"name" : "staging:27019",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 41706,
"optime" : Timestamp(1460455377, 2),
"optimeDate" : ISODate("2016-04-12T10:02:57Z"),
"lastHeartbeat" : ISODate("2016-04-12T10:23:45.344Z"),
"lastHeartbeatRecv" : ISODate("2016-04-12T10:23:45.343Z"),
"pingMs" : 0,
"syncingTo" : "staging:27017",
"configVersion" : 1
}
],
"ok" : 1
}
Error logs reported by mupx logs --tail=300
:
[45.79.139.28] => Starting meteor app on port:80
[45.79.139.28]
[45.79.139.28] /bundle/bundle/programs/server/node_modules/fibers/future.js:300
[45.79.139.28] throw(ex);
[45.79.139.28] ^
[45.79.139.28] Error: Could not locate any valid servers in initial seed list
[45.79.139.28] at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:420:15)
[45.79.139.28] at new MongoConnection (packages/mongo/mongo_driver.js:213:27)
[45.79.139.28] at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
[45.79.139.28] at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
[45.79.139.28] at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
[45.79.139.28] at new Mongo.Collection (packages/mongo/collection.js:102:40)
[45.79.139.28] at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
[45.79.139.28] at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
[45.79.139.28] at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
[45.79.139.28] at fileEvaluate (packages/modules-runtime.js:158:9)
[45.79.139.28] - - - - -
[45.79.139.28] at /bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/mongodb/mongo_client.js:329:26
[45.79.139.28] at process._tickCallback (node.js:458:13)
[45.79.139.28] npm WARN deprecated This version of npm lacks support for important features,
[45.79.139.28] npm WARN deprecated such as scoped packages, offered by the primary npm
[45.79.139.28] npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
[45.79.139.28] npm WARN deprecated latest stable version. To upgrade to npm@2, run:
[45.79.139.28] npm WARN deprecated
[45.79.139.28] npm WARN deprecated npm -g install npm@latest-2
[45.79.139.28] npm WARN deprecated
[45.79.139.28] npm WARN deprecated To upgrade to the latest stable version, run:
[45.79.139.28] npm WARN deprecated
[45.79.139.28] npm WARN deprecated npm -g install npm@latest
[45.79.139.28] npm WARN deprecated
[45.79.139.28] npm WARN deprecated (Depending on how Node.js was installed on your system, you
[45.79.139.28] npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
[45.79.139.28] npm WARN deprecated on Windows, run them from an Administrator prompt.)
[45.79.139.28] npm WARN deprecated
[45.79.139.28] npm WARN deprecated If you're running the version of npm bundled with
[45.79.139.28] npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
[45.79.139.28] npm WARN deprecated will be bundled with a version of npm@2, which has some small
[45.79.139.28] npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
[45.79.139.28] npm WARN deprecated semver behavior.
[45.79.139.28] npm WARN package.json [email protected] No description
[45.79.139.28] npm WARN package.json [email protected] No repository field.
[45.79.139.28] npm WARN package.json [email protected] No README data
- I am using MongoDB
3.0.7
. - Project runs fine locally.
- Using mupx
1.5.3
.
from meteor-up.
@joncursi OPLOG is not implemented yet, what I can tell
from meteor-up.
Shouldn't manual passing of MONGO_OPLOG_URL
work, though? I thought mup
just passes through environment variables.
from meteor-up.
It should work fine with external mongo installation. as @wizonesolutions said mup just passes the env vars in.
from meteor-up.
Does it work that way even though mongo is run within a docker container? What other steps is needed to turn on oplog in mongo?
from meteor-up.
Im guessing you put your mongodb settings
https://docs.mongodb.org/manual/reference/configuration-options/
in here somehow?
https://github.com/kadirahq/meteor-up/blob/master/src/modules/mongo/assets/mongodb.conf
from meteor-up.
@madushan1000 is this even possible?
I need to link
my mongo container with the meteor container, but #157 (comment) shows that this is not possible trough pure configuration.
Do you see a valid solution on this?
from meteor-up.
You can publish the mongo port to the localhost and pass it as the MONGO_URL
from settings. If you have to link, you are going to have to modify the mup source.
from meteor-up.
Any ideas of how to set MONGO_OPLOG_URL for compose.io configuration?
Here's my current config, which I got from compose.io, there's only 1 line:
mongodb://user:[email protected]:15123,capital.1.mongolayer.com:15123/app-production?replicaSet=set-9835234s0y34gg35j63532dc
I'm passing it into MONGO_URL, but the OPLOG is not working.
from meteor-up.
This is available in Mup 1.4. You can try the beta following the instructions in #870. Docs for the oplog were added here.
from meteor-up.
What if I don't want to use an oplog? How do I disable it from within the settings file?
from meteor-up.
It currently isn't possible to. Please create a new issue for disabling the oplog.
from meteor-up.
Related Issues (20)
- Error: Cannot parse privateKey: Unsupported OpenSSH private key type: ssh-ed25519 HOT 4
- MongoServerSelectionError: connect ECONNREFUSED
- Error on deploy - stat: cannot statx HOT 3
- Deployment Fails when including fido2-lib HOT 1
- Some package updates
- BuildKit problems HOT 2
- use mongosh to support mongodb 6.x.x
- Using MUP proxy along side local web-server
- mup no longer updates the ssl certificates
- how to create mongo authentication ?
- Proxy does not work on Ubuntu 22.x, but works fine on 20.x with same config HOT 1
- Deployment failed [email protected] HOT 5
- Updating nginx
- mup deploy stucked at 0% when pushing to the server HOT 8
- mup deploy stucked at Step 13/13
- Unable to execute mup proxy reconfig-shared
- Question about proxy.loadBalancing
- Mup with another database Docker container, like Postgres
- Deployment gets stuck while verifying and breaks afterwards HOT 5
- Issue with Ubuntu 22 which uses latest ssh2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-up.