phenomenon: there are some task failed, actually, each node include failed task and successfull task, the failed task failed with No hosts available when create keyspace(CassFuture* future = cass_session_execute(session, statement): it seems this return No hosts available error), the error code is: CASS_ERROR_LIB_NO_HOSTS_AVAILABLE
I am a new user of cassandra, can you help me? I indeed no idea about this, why some task on a node sucessful, but some failed... thanks very much.
Hi, everyone
I have write a post yesterday to describe my situation, thanks yours reply. I will describe my error and code more detail here with a new post, please help me, thanks!
Driver: C/C++ driver
cassandra environment: I have three linux machine and install cassandra on each mancine, the ip is 100.142.31.176, 100.142.31.177 and 100.142.31.178; 100.142.31.176 is the seed node, in my cassandra.yaml, I configure all parameter I know need to config, include rpc address: 0.0.0.0, broad cast rpc address: localhost. all cassandra is up when use ./nodetool status, and can ssh each other when use ./cqpsh <ip>;
demo task: I run at least 10 task which will run in three node(average again on three node)
demo code describe: when a task on a node comming, then the demo code will do below thing:
1. create cluster:
m_cluster = cass_cluster_new();
cass_cluster_set_request_timeout(m_cluster, 50000);
cass_cluster_set_latency_aware_routing(m_cluster, cass_treue);
cass_cluster_set_core_connections_per_host(m_cluster, 50);
cass_cluster_set_max_connections_per_host(m_cluster, 100);
....
cass_cluster_set_contact_point(m_cluster, "127.0.0.1");
....
2. create session and connection...
CassSession* session = cass_session_new();
CassFuture* connect_future = cass_session_connect(session, m_cluster);
....
3. create keyspace belong the task..
phenomenon: there are some task failed, actually, each node include failed task and successfull task, the failed task failed with No hosts available when create keyspace(CassFuture* future = cass_session_execute(session, statement): it seems this return No hosts available error), the error code is: CASS_ERROR_LIB_NO_HOSTS_AVAILABLE
I am a new user of cassandra, can you help me? I indeed no idea about this, why some task on a node sucessful, but some failed... thanks very much.
--
You received this message because you are subscribed to the Google Groups "DataStax C++ Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.
在 2015年11月27日星期五 UTC+8上午10:33:19,Neil Ablang写道:
> On Fri, Nov 27, 2015 at 10:10 AM, Jet Li <jetli...@gmail.com> wrote:
> Hi, everyone
>
> I have write a post yesterday to describe my situation, thanks yours reply. I will describe my error and code more detail here with a new post, please help me, thanks!
>
> Driver: C/C++ driver
>
> cassandra environment: I have three linux machine and install cassandra on each mancine, the ip is 100.142.31.176, 100.142.31.177 and 100.142.31.178; 100.142.31.176 is the seed node, in my cassandra.yaml, I configure all parameter I know need to config, include rpc address: 0.0.0.0, broad cast rpc address: localhost. all cassandra is up when use ./nodetool status, and can ssh each other when use ./cqpsh <ip>;
>
> demo task: I run at least 10 task which will run in three node(average again on three node)
>
> demo code describe: when a task on a node comming, then the demo code will do below thing:
>
> 1. create cluster:
>
> m_cluster = cass_cluster_new();
>
> cass_cluster_set_request_timeout(m_cluster, 50000);
>
> cass_cluster_set_latency_aware_routing(m_cluster, cass_treue);
>
> cass_cluster_set_core_connections_per_host(m_cluster, 50);
>
> cass_cluster_set_max_connections_per_host(m_cluster, 100);
>
> ....
>
> cass_cluster_set_contact_point(m_cluster, "127.0.0.1");
>
>
>
> >>> Neil ------> This may be your problem : cass_cluster_set_contact_point(m_cluster, "127.0.0.1") -- set listen_address to you server ip address for each server and set rpc_address to you server address for each server and try if works. These parameters are found in your cassandra.yaml file. Then on you program set the address to one of you server IP address instead of the 127.0.0.1 in the code you presented
>>>>Liwei: Hi, Neil, thanks for your fast reply, I have some doubt about your answer, if the reason is the contact point "127.0.0.1", I think maybe all task should failed, but some of task failed and some of task successful, and If I run less task(such 3 task and each node will include 1 task), all task can success. I tried change contact point from 127.0.0.1 to local server ip, but no use actually, thanks!
Hi Liwei,
You can put the ip addresses of all the nodes in an array to create a pool of connections as a practice in programming cassandra. Im not sure on c++ api, but i remember it is done that way too. Create a pool of connections. Its been a long time i didnt use the c++ api for its a lot easier and faster to develop in python especially when doing a lot of text manipulations.
Best Regards
Neil Ablang
Ill review the c++ api later and let you know
Hi Liwei,
Your code should look like this in creating the connection pool:
cass_cluster_set_contact_points(cluster, "100.142.31.176,100.142.31.177,100.142.31.178");
Yes, I do like this.
Only just that there will be a lot of node in my future work, so I just set seed node and local machine as the contact point, maybe I need set the routing for contact points.
Best wishes
Liwei
On my setup , I only use 3 or 5 at max for the connection pool. Thats is a cluster and one node knows everyone in the cluster and where to get the data you are looking for. No need to put all your node addresses I suppose
Hi Liwei,
Were you able to resolve this?
I am encountering the same issue and would really appreciate some feedback.
I am using 2.1 version driver.
Thanks in advance!