Class which returns all ports to set in core builder


#1

Hi, is there a java api which we can call while knowing only rest port port, and that returns a class which has info about below ports ?
bootstrapHttpDirectPort=8091
bootstrapHttpSslPort=18091
bootstrapCarrierDirectPort=11210
bootstrapCarrierSslPort=11207

These ports can then be used to create a core which will be used for further calls.


#2

I can do this by calling GetClusterConfigRequest .
I created env by setting rest port and disabled carrier port.

I have to create core with carrier port disabled, is that safe and guaranteed to work ?


#3

rest port is bootstrapHttpDirectPort above… and if SSL is activated, you’ll need to also know bootstrapHttpSslPort

these four ports should be known to you, generally speaking. From there, you can discover additional ports like the data port, query port, view port, etc…

what is your use case, exactly?

carrier bootstrap is something that was added back in Couchbase Server 3.0, and http bootstrap has always existed. note that if carrier is tried first and it automatically falls back to http, so you shouldn’t even have to disable it yourself.

Side note: if you still go this way, don’t forget to call shutdown().toBlocking().single() on the temp environment (or just shutdown() if you use a recent SDK).