Subject: Re: [mongodb-user] Re: MongoDB 3.4 Sharded Cluster



Why not follow the docs instructions?  See here:
https://docs.mongodb.com/manual/tutorial/convert-replica-set-to-replicated-shard-cluster/#deploy-the-config-servers-as-a-three-member-replica-set

Looks like you are missing the part where you connect to config servers and configure the replica set (the rs.initiate() section you quoted but didn’t mention running).
Asya

On Wed, Aug 9, 2017 at 8:48 PM, Alan <[email protected]> wrote:
Hi Jacek or anyone who also may help,
The Mongo 3.4 Shard setup is different compared to previous versions from what I understand.  Here are the instructions that I am supposed to perform: 

Stop the mongod process. Now, restart the mongod process adding the option --shardsvr. If you started mongod with a --dbpath option, specify that as well.

mongod --shardsvr ...

Note that with --shardsvr specified the default port for mongod becomes 27018.


Start a mongo config server:

mongod --configsvr ...


Note: configuration server setup has changed. If you are using MongoDB 3.4 you must set up your configuration servers with CSRS. An example setup is as follows:


mongod --configsvr --replSet csReplSet ...
mongod --configsvr --replSet csReplSet ...
mongod --configsvr --replSet csReplSet ...

mongo --port 27019

config = { _id: "csReplSet", members:[
         { _id : 0, host : "localhost:27019" },
         { _id : 1, host : "localhost:27020" },
         { _id : 2, host : "localhost:27021" }]};
rs.initiate(config)


(Note with --configsvr specified the default port for listening becomes 27019 and the default data directory /data/configdb. Wherever your data directory is, it is suggested that you verify that the directory is empty before you begin.)


Start a mongos:

mongos --configdb your_host_name:27019


These are the steps I tried from what I have gathered so far: 
mongod --shardsvr --replSet a --dbpath a0 --logpath log.a0 --port 27000 --fork --logappend --smallfiles --oplogSize 50
mongod --shardsvr --replSet a --dbpath a1 --logpath log.a1 --port 27001 --fork --logappend --smallfiles --oplogSize 50
mongod --shardsvr --replSet a --dbpath a2 --logpath log.a2 --port 27002 --fork --logappend --smallfiles --oplogSize 50

mongod --configsvr --replSet a --dbpath cfg0 --port 26050 --fork --logpath log.cfg0 --logappend
mongod --configsvr --replSet a --dbpath cfg1 --port 26051 --fork --logpath log.cfg1 --logappend
mongod --configsvr --replSet a --dbpath cfg2 --port 26052 --fork --logpath log.cfg2 --logappend

mongos --configdb m034:26050,m034:26051,m034:26052 --fork --logappend --logpath log.mongos0

It looks like I'm missing the step where it says if you're using Mongo 3.4, you must set up you configuration servers with CSRS.  What steps am I missing in order to get it to work?  Please help me fill in the missing steps.  Thanks.



On Wednesday, August 9, 2017 at 12:19:45 PM UTC-10, Alan wrote:Can someone show me simple step by step instructions of how to setup a MongoDB sharded cluster in Mongo 3.4.  From what I understand, Mongo 3.4 has a different way of setting it up compared to previous versions.  So far I tried the following but it doesn't seem to work.

mongod --configsvr --dbpath cfg0 --port 26050 --fork --logpath log.cfg0 --logappend
mongod --configsvr --dbpath cfg1 --port 26051 --fork --logpath log.cfg1 --logappend
mongod --shardsvr --replSet a --dbpath a0 --logpath log.a0 --port 27000 --fork --logappend --smallfiles --oplogSize 50
mongod --shardsvr --replSet a --dbpath a1 --logpath log.a1 --port 27001 --fork --logappend --smallfiles --oplogSize 50
mongos --configdb m034:26050,m034:26051,m034:26052 --fork --logapend --logpath log.mongos0
FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set connection string
try 'mongos --help' for more information

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/5dff7862-c497-4450-b6d4-0dc4a0908987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
We're Hiring! - https://www.mongodb.com/careers

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJB%3DMhihjbNtx%3DAGHQMZSRjd-oBk1MRy-HZ-XLcubpehwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



Programming list archiving by: Enterprise Git Hosting