Discussion:
how can i change the port numbers for all members of a replicate set
(too old to reply)
davidmo
2018-11-28 20:09:05 UTC
Permalink
hi all. mongodb 3.0.7 going to 3.6.8.

is there a way to change the port for all members of a replicate set safely
so that i can keep it up

but know for sure that users cannot get in ? something like:

change secondary B port to 38011
bounce secondary B
change secondary C port to 38011
bounce secondary C
step down the primary A
change secondary A port to 38011
bounce secondary A

then reconfig so all hostnames include have port 38011

now cluster is up and its mine


this sound do-able ? has anyone done this ? is there another was to
accomplish this that has worked for you ?

thanks
--
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 mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
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/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bob Cochran
2018-11-28 21:39:48 UTC
Permalink
Hi,

Instead of changing port numbers it might be a lot simpler to implement a firewall rule that drops all incoming traffic with a destination port of the current MongoDB ports except traffic from your ip and the localhost (127.0.0.1) ip. You can also disable all other software services (such as web servers or node.js, etc) which might connect to that instance of MongoDB. I think it is cleaner to filter network traffic than to change all your ports just to block traffic.

With that said, others may have better advice than I.

Thanks

Bob
Post by davidmo
hi all. mongodb 3.0.7 going to 3.6.8.
is there a way to change the port for all members of a replicate set safely so that i can keep it up
change secondary B port to 38011
bounce secondary B
change secondary C port to 38011
bounce secondary C
step down the primary A
change secondary A port to 38011
bounce secondary A
then reconfig so all hostnames include have port 38011
now cluster is up and its mine
this sound do-able ? has anyone done this ? is there another was to accomplish this that has worked for you ?
thanks
--
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.
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/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
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/72334C6E-59F5-46CB-9088-355D79C610F6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Robert Cochran
2018-11-29 00:34:46 UTC
Permalink
Hi,

I was curious about this, and started looking at Hadoop and MongoDb's
Hadoop Connector. Then I looked again at your email and noticed the Java
driver version you quote -- 3.2.1 -- does not support MongoDB server
version 4.x. I suspect you need to upgrade your MongoDB Java driver version
-- try the 3.9.1 version.

In my opinion, the MongoDB Hadoop connector available on GitHub has not had
an active commit since 2017. That was a while ago! The connector itself
might need updating or correction, in order for it to work with MongoDB
4.x.

With that said, you don't mention whether you already have a collection
containing the data of interest to you. From the code example you show --
it appears that you do have a real MongoDB collection that you can work
with and which is populated with data. So perhaps the true issue is that
the Java driver is too old to support MongoDB 4.x, and the Hadoop connector
might also be too old, too.

One last suggestion. I think your source data might be too complicated when
you are just starting out. Why not start with a very simple MongoDB
collection, until you have a working Hadoop/Java driver/Hive
implementation? Like so:

MongoDB Enterprise > use hadoop

switched to db hadoop

MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("1") } )

WriteResult({ "nInserted" : 1 })

MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("3") } )

WriteResult({ "nInserted" : 1 })

MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("4") } )

WriteResult({ "nInserted" : 1 })

MongoDB Enterprise > db.tc.find({})

{ "_id" : ObjectId("5bff32b51b4428a5aaedf37a"), "a" : 1 }

{ "_id" : ObjectId("5bff32c71b4428a5aaedf37b"), "a" : 3 }

{ "_id" : ObjectId("5bff32ce1b4428a5aaedf37c"), "a" : 4 }


So with the above, you get 3 nice simple documents to start with, and you
know exactly what they should look like. That will help you get your Hadoop
implementation going.


Thanks so much

Bob
Post by Bob Cochran
Hi,
Instead of changing port numbers it might be a lot simpler to implement a
firewall rule that drops all incoming traffic with a destination port of
the current MongoDB ports except traffic from your ip and the localhost
(127.0.0.1) ip. You can also disable all other software services (such as
web servers or node.js, etc) which might connect to that instance of
MongoDB. I think it is cleaner to filter network traffic than to change all
your ports just to block traffic.
With that said, others may have better advice than I.
Thanks
Bob
hi all. mongodb 3.0.7 going to 3.6.8.
is there a way to change the port for all members of a replicate set
safely so that i can keep it up
change secondary B port to 38011
bounce secondary B
change secondary C port to 38011
bounce secondary C
step down the primary A
change secondary A port to 38011
bounce secondary A
then reconfig so all hostnames include have port 38011
now cluster is up and its mine
this sound do-able ? has anyone done this ? is there another was to
accomplish this that has worked for you ?
thanks
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
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
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/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
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/CAMZC1ceM2%2B0Enp6WaxHXZqqM%2BEG5NaMp9wjrSbQSMD3Zeg8Xxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Robert Cochran
2018-11-29 00:40:35 UTC
Permalink
I apologize, the Hadoop material was intended for a different post in this
forum. Somehow, I accidentally added it to this post when I meant it to go
into a different post. Sorry for the inconvenience.

Thanks

Bob
Post by Robert Cochran
Hi,
I was curious about this, and started looking at Hadoop and MongoDb's
Hadoop Connector. Then I looked again at your email and noticed the Java
driver version you quote -- 3.2.1 -- does not support MongoDB server
version 4.x. I suspect you need to upgrade your MongoDB Java driver version
-- try the 3.9.1 version.
In my opinion, the MongoDB Hadoop connector available on GitHub has not
had an active commit since 2017. That was a while ago! The connector itself
might need updating or correction, in order for it to work with MongoDB
4.x.
With that said, you don't mention whether you already have a collection
containing the data of interest to you. From the code example you show --
it appears that you do have a real MongoDB collection that you can work
with and which is populated with data. So perhaps the true issue is that
the Java driver is too old to support MongoDB 4.x, and the Hadoop connector
might also be too old, too.
One last suggestion. I think your source data might be too complicated
when you are just starting out. Why not start with a very simple MongoDB
collection, until you have a working Hadoop/Java driver/Hive
MongoDB Enterprise > use hadoop
switched to db hadoop
MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("1") } )
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("3") } )
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise > db.tc.insert( { "a" : NumberInt("4") } )
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise > db.tc.find({})
{ "_id" : ObjectId("5bff32b51b4428a5aaedf37a"), "a" : 1 }
{ "_id" : ObjectId("5bff32c71b4428a5aaedf37b"), "a" : 3 }
{ "_id" : ObjectId("5bff32ce1b4428a5aaedf37c"), "a" : 4 }
So with the above, you get 3 nice simple documents to start with, and you
know exactly what they should look like. That will help you get your Hadoop
implementation going.
Thanks so much
Bob
Post by Bob Cochran
Hi,
Instead of changing port numbers it might be a lot simpler to implement a
firewall rule that drops all incoming traffic with a destination port of
the current MongoDB ports except traffic from your ip and the localhost
(127.0.0.1) ip. You can also disable all other software services (such as
web servers or node.js, etc) which might connect to that instance of
MongoDB. I think it is cleaner to filter network traffic than to change all
your ports just to block traffic.
With that said, others may have better advice than I.
Thanks
Bob
hi all. mongodb 3.0.7 going to 3.6.8.
is there a way to change the port for all members of a replicate set
safely so that i can keep it up
change secondary B port to 38011
bounce secondary B
change secondary C port to 38011
bounce secondary C
step down the primary A
change secondary A port to 38011
bounce secondary A
then reconfig so all hostnames include have port 38011
now cluster is up and its mine
this sound do-able ? has anyone done this ? is there another was to
accomplish this that has worked for you ?
thanks
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
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
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/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/3b48149d-8d56-417e-8d60-b518829eabe0%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
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/b52bd0d9-9889-475d-901d-a8a5e6271d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...