Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

ranjeet_ranjee avatar image
ranjeet_ranjee asked ·

Why am I getting "error creating pool to /Public_ip-1:9042" after restarting my application?

Hi Restarted my application and getting error in the application.

2020-04-22 20:26:07.257  INFO 5267 --- [           main] com.datastax.driver.core.Cluster         : New Cassandra host /Public_ip:9042 added
2020-04-22 20:26:07.257  INFO 5267 --- [           main] com.datastax.driver.core.Cluster         : New Cassandra host /10.130.1.204:9042 added
2020-04-22 20:26:07.353  WARN 5267 --- [r1-nio-worker-1] com.datastax.driver.core.Session         : Error creating pool to /Public_ip-1:9042

com.datastax.driver.core.exceptions.ConnectionException: [/Public_ip:9042] Pool was closed during initialization
    at com.datastax.driver.core.HostConnectionPool$2.onSuccess(HostConnectionPool.java:148) [cassandra-driver-core-3.2.0.jar!/:na]
    at com.datastax.driver.core.HostConnectionPool$2.onSuccess(HostConnectionPool.java:134) [cassandra-driver-core-3.2.0.jar!/:na]
cassandra
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered ·

@ranjeet_ranjee Based on the other issues you posted, it appears that you've removed nodes from your cluster but you haven't updated your configuration. The exception indicates that the IP Public_ip-1 either does not exist or is unreachable.

In another post, you stated that there are only 2 nodes in your cluster so you will need to review the contact points you have specified in your code to only have the IPs of the 2 nodes:

DC: singaporedo     Workload: Cassandra       Graph: no     
======================================================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--   Address   Load       Owns   Token                    Rack   Health [0,1] 
                                  1051212759506365289
UN   Node-1   379.53 GiB     ?      -9962553594005710   rack-1   0.90         
UN   Node-12  407.37 GiB     ?      10212759506365289   rack-1   0.90

Based on the other issues you reported in other posts, the indications are you did not decommission the other DC correctly so the IP address(es) of the old nodes did not get removed from the cluster. You will need to review the each of the 2 nodes' system.peers table and manually delete the IPs which are no longer part of the cluster.

Once you've done all the necessary remediation, you will need to restart your application again. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

saravanan.chinnachamy_185977 avatar image
saravanan.chinnachamy_185977 answered ·

Hi Ranjeet,


Can you please check rpc_address\broadcast_rpc_address is set right? Please refer the documentation for how to validate and set these values.

Broadcast RPC address should be accessible from the client machine where the driver will run.

https://docs.datastax.com/en/developer/java-driver/4.5/manual/core/address_resolution/

Thanks

Saravanan

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.