Skip to content

Commit a1b1668

Browse files
committed
Fix Meteor 2.6 compatilibity
1 parent 39eff8d commit a1b1668

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.5.6 - February 13, 2022
2+
3+
- Fix connecting to built-in MongoDB with Meteor 1.6. The replica set now uses `mongodb:27017` as the member's hostname instead of `127.0.0.1:27017`
4+
15
## 1.5.5 - September 30, 2021
26

37
- Config created by `mup init` now uses `zodern/meteor:root` as docker image

docs/docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ Mup supports Meteor 1.2 and newer, though you might need to change the docker im
293293
| Meteor version | Docker image | Prepare Bundle | Notes |
294294
| --- | --- | --- |
295295
| 1.2 - 1.3 | `kadirahq/meteord` | false | This is the default docker image. When using Meteor 1.2, `app.buildOptions.serverOnly` should be false. |
296-
| 1.2 - 2.4 and newer | `zodern/meteor:root` | true | Automatically uses the correct node version for the app's Meteor version. |
296+
| 1.2 - 2.6 and newer | `zodern/meteor:root` | true | Automatically uses the correct node version for the app's Meteor version. |
297297
| 1.4 - 1.5 | `abernix/meteord:node-4-base` | true | |
298298
| 1.6 - 1.8| `abernix/meteord:node-8-base` | true | |
299299
| 1.9 - 2.2 | `abernix/meteord:node-12-base` | true | |

src/plugins/mongo/assets/templates/start.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ sudo docker run \
3131
--log-opt max-size=100m \
3232
--log-opt max-file=7 \
3333
--name=mongodb \
34+
--hostname mongodb \
3435
mongo:$MONGO_VERSION mongod -f /mongodb.conf
3536

3637

@@ -43,7 +44,7 @@ while [[ true ]]; do
4344
sleep 1
4445
elaspsed=$((elaspsed+1))
4546
sudo docker exec mongodb mongo --eval \
46-
'rs.initiate({_id: "meteor", members: [{_id: 0, host: "127.0.0.1:27017"}]});' \
47+
'var c = rs.config(); if (c && c.members[0].host === "127.0.0.1:27017") { c.members[0].host = "mongodb:27017"; rs.reconfig(c); } else { rs.initiate({_id: "meteor", members: [{_id: 0, host: "mongodb:27017"}]}) }' \
4748
&& exit 0
4849

4950
if [ "$elaspsed" "==" "$limit" ]; then

src/plugins/mongo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function prepareConfig(config) {
1616

1717
config.app.env = config.app.env || {};
1818
config.mongo.dbName = config.mongo.dbName || config.app.name.split('.').join('');
19-
config.app.env.MONGO_URL = `mongodb://mongodb:27017/${config.mongo.dbName}`;
19+
config.app.env.MONGO_URL = `mongodb://mongodb:27017/${config.mongo.dbName}?replicaSet=meteor`;
2020

2121
if (!config.app.docker) {
2222
config.app.docker = {};

0 commit comments

Comments
 (0)