无法使用erlcassa将erlang-application连接到cassandra

时间:2014-08-13 10:08:58

标签: cassandra erlang

我无法使用ErlCassa将我的Erlang应用程序连接到Cassandra。我收到以下错误消息:

11> {ok, Cl} = erlcassa_client:connect("0.0.0.0", 9160).   
** exception error: no case clause matching {'EXIT',{undef,[{thrift_client_util,new,
                                                                                ["0.0.0.0",9160,cassandra_thrift,[{framed,true}]],
                                                                                []},
                                                            {erlcassa_client,connect,2,
                                                                             [{file,"src/erlcassa_client.erl"},{line,41}]},
                                                            {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,573}]},
                                                            {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,364}]},
                                                            {shell,exprs,7,[{file,"shell.erl"},{line,674}]},
                                                            {shell,eval_exprs,7,[{file,"shell.erl"},{line,629}]},
                                                            {shell,eval_loop,3,[{file,"shell.erl"},{line,614}]}]}}
     in function  erlcassa_client:connect/2 (src/erlcassa_client.erl, line 41)


10> {ok, Cl} = erlcassa_client:connect("localhost", 9160).
** exception error: no case clause matching {'EXIT',{undef,[{thrift_client_util,new,
                                                                                ["localhost",9160,cassandra_thrift,[{framed,true}]],
                                                                                []},
                                                            {erlcassa_client,connect,2,
                                                                             [{file,"src/erlcassa_client.erl"},{line,41}]},
                                                            {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,573}]},
                                                            {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,364}]},
                                                            {shell,exprs,7,[{file,"shell.erl"},{line,674}]},
                                                            {shell,eval_exprs,7,[{file,"shell.erl"},{line,629}]},
                                                            {shell,eval_loop,3,[{file,"shell.erl"},{line,614}]}]}}
     in function  erlcassa_client:connect/2 (src/erlcassa_client.erl, line 41)
Erlang version:
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Cassandra version:
 INFO 12:59:51,051 Cassandra version: 1.1.12
 INFO 12:59:51,051 Thrift API version: 19.33.0
 INFO 12:59:51,053 CQL supported versions: 2.0.0,3.0.0-beta1 (default: 2.0.0)

1 个答案:

答案 0 :(得分:0)

我认为您需要将此“https://github.com/interline/erlang-thrift”dep添加到您的项目中。 因为erlcassa的代码试图使用这个dep的函数“thrift_client_util”而它找不到它,因为dep没有用项目编译。