Ganesh
Ganesh

Reputation: 867

connect to cassandra with same ip but diffrent port

I am using cassandra 3.6 and 3 node of cassandra

seed node is in 111.1.11.111 this ip

and two other node is in 222.2.22.222 this ip

I changed the below port in cassandra.yml

storage_port:               node3=7000, node2=7005

ssl_storage_port:           node3=7001, node2=7006

native_transport_port:      node3=9042, node2=9043  

rpc_port:                   node3=9160, node2=9161

but when I want to connect node2 using cqlsh 222.2.22.222 this will connect to 9042 default node3.

where did i change the config to ask or give the port to connect which node I want to connect I do.

Upvotes: 0

Views: 35

Answers (1)

dilsingi
dilsingi

Reputation: 2958

cqlsh commands accept host and port. Here is the generic syntax

cqlsh [options] [host [port]]

In your case, in order to connect to node2, it would be

cqlsh 222.2.22.222 9043

Reference for cqlsh.

Upvotes: 1

Related Questions