Connect to multiple node using pandra

6 views
Skip to first unread message

weeladalah

unread,
Jun 28, 2010, 1:21:42 AM6/28/10
to pandra-dev
Hi,

I want to connect my application to several cassandra node. But, how
to connect to several cassandra node using Pandra 0.2??

Thanks :)

Michael Pearson

unread,
Jun 28, 2010, 9:38:04 PM6/28/10
to pandr...@googlegroups.com
Hey :)

Seeded connections are handled in PandraCore::auto($host); - just
point it at the node you want and it will auto discover the rest in
the ring.t

hope that helps, let me know if not!
-michael

Hendro Wibowo

unread,
Jun 29, 2010, 2:31:46 AM6/29/10
to pandr...@googlegroups.com
Hey thanks for your reply... :)
Okay i will try this to my application and tells to you that's works or not...

weeladalah

unread,
Jul 6, 2010, 1:20:12 AM7/6/10
to pandra-dev
Hi,
That's work...!!! :D
But, i have question below:

I have 3 node => node1, node2, and node3.
In my application, i write this code to connect to node1:
PandraCore::auto('node1');

Can my application automatically connect to other node (node2 or
node3) when i turn off node1?

Thanks,


On Jun 29, 8:38 am, Michael Pearson <mjpear...@gmail.com> wrote:
> Hey :)
>
> Seeded connections are handled in PandraCore::auto($host); - just
> point it at the node you want and it will auto discover the rest in
> the ring.t
>
> hope that helps, let me know if not!
> -michael
>

Josh

unread,
Jul 6, 2010, 2:02:15 AM7/6/10
to pandr...@googlegroups.com
I tried, it doesn't work.

Josh

2010/7/6 weeladalah <hendro...@gmail.com>
Message has been deleted

mjpearson

unread,
Jul 6, 2010, 11:52:29 PM7/6/10
to pandra-dev
Hi, sorry for the late reply.

Yes, you're right Pandra won't be able to detect other nodes in the
ring automatically. The best way to do this for failover is to
iterate over an array of known seeds, breaking on the first success.
eg :

$hosts = array('host1', 'host2', 'host3');
$ok = FALSE;
foreach ($hosts as $host) {
$ok = PandraCore::auto($host);
if ($ok) break;

}

if (!$ok) echo 'All nodes unavailable';

... hope that helps

- michael

On Jul 5, 11:02 pm, Josh <noisyw...@gmail.com> wrote:
> I tried, it doesn't work.
>
> Josh
>
> 2010/7/6 weeladalah <hendrothem...@gmail.com>

Hendro Wibowo

unread,
Jul 7, 2010, 12:08:45 AM7/7/10
to pandr...@googlegroups.com
okay thanks for your help...
i'll try it..
:)
Reply all
Reply to author
Forward
0 new messages