how do i link the riak-erlang-client to the Erland node?

Dan Reverri reverri at gmail.com
Sat May 1 14:48:44 EDT 2010


Hi Norman,

The documentation is incorrect. Here is a quick session I just ran to use
riakc:

[~/Projects/riakc]$ erl -pa ebin/ deps/*/ebin
Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2]
[async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.5  (abort with ^G)
1> {ok, RiakcSocket} = riakc_pb_socket:start_link({127,0,0,1}, 8087).
{ok,<0.34.0>}
2> O = riakc_obj:new(<<"bucket">>, <<"key">>, <<"Hello World">>,
"text/plain").
{riakc_obj,<<"bucket">>,<<"key">>,undefined,undefined,
           {dict,1,16,16,8,80,48,
                 {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},

{{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},
           <<"Hello World">>}
3> O = riakc_obj:new(<<"bucket">>, <<"key">>, <<"Hello World">>,
"text/plain").
{riakc_obj,<<"bucket">>,<<"key">>,undefined,undefined,
           {dict,1,16,16,8,80,48,
                 {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},

{{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},
           <<"Hello World">>}
4> riakc_pb_socket:put(RiakcSocket, O, [return_body]).
{ok,{riakc_obj,<<"bucket">>,<<"key">>,
               <<107,206,97,96,96,96,204,96,202,5,82,44,108,223,42,215,
                 101,48,37,50,230,177,50,...>>,
               [{{dict,3,16,16,8,80,48,
                       {[],[],[],[],[],[],[],[],[],[],[],[],...},
                       {{[],[],[],[],[],[],[],[],[],[],...}}},
                 <<"Hello World">>}],
               {dict,0,16,16,8,80,48,
                     {[],[],[],[],[],[],[],[],[],[],[],[],[],...},
                     {{[],[],[],[],[],[],[],[],[],[],[],...}}},
               undefined}}
5>


You'll notice I had to include "ebin" and "deps/*/ebin". The deps ebin was
necessary for the protobuffs dependency. You'll also notice I didn't
reference the client at all.

Thanks,
Dan

On Sat, May 1, 2010 at 4:20 AM, Norman Khine <norman at khine.net> wrote:

> hi
>
> On Sat, May 1, 2010 at 12:30 AM, Dan Reverri <reverri at gmail.com> wrote:
> > Can you try running "make clean && make all"?
>
> yes i did this but still unable to link the library to Erlang?
>
> araweelo:riak khinester$ erl -version
> Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.7.5
> araweelo:~ khinester$ erl -pa $RIAKC/ebinErlang R13B04 (erts-5.7.5)
> [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe]
> [kernel-poll:false]
>
> Eshell V5.7.5  (abort with ^G)
> 1> code:which(riakc_pb_client).
> non_existing
> 2>
>
>
> > It should fetch the protobuffs dependency and compile everything. Once
> this
> > is complete run:
> > erl -pa $RIAKC/ebin
> > Make sure $RIAKC points to the path where you have cloned the
> > riak-erlang-client repo.
>
> araweelo:riak khinester$ echo $RIAKC
> /Users/khinester/Sandboxes/riak/client_lib/riak-erlang-client
> araweelo:riak khinester$ tree -L 2
> /Users/khinester/Sandboxes/riak/client_lib/riak-erlang-client/
> /Users/khinester/Sandboxes/riak/client_lib/riak-erlang-client/
> |-- LICENSE
> |-- Makefile
> |-- README
> |-- deps
> |   `-- protobuffs
> |-- docs
> |   `-- pb-client.txt
> |-- ebin
> |   |-- riakc.app
> |   |-- riakc_obj.beam
> |   |-- riakc_pb.beam
> |   |-- riakc_pb_socket.beam
> |   `-- riakclient_pb.beam
> |-- include
> |   |-- riakc_obj.hrl
> |   |-- riakc_pb.hrl
> |   `-- riakclient_pb.hrl
> |-- rebar
> |-- rebar.config
> `-- src
>    |-- riakc_obj.erl
>    |-- riakc_pb.erl
>    |-- riakc_pb_socket.erl
>    `-- riakclient.proto
>
> 6 directories, 18 files
>
> >
> >
> > On Fri, Apr 30, 2010 at 2:16 PM, Norman Khine <norman at khine.net> wrote:
> >>
> >> hello,
> >> i am following the riak/client_lib/riak-erlang-client/docs/pb-client.txt
> >> but am stuck on this point:
> >>
> >> $ erl -pa $RIAKC/ebin
> >> Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2]
> >> [async-threads:0] [hipe] [kernel-poll:false]
> >>
> >> Eshell V5.7.5  (abort with ^G)
> >> 1> code:which(riakc_pb_client).
> >> non_existing
> >> 2>
> >> User switch command
> >>  --> q
> >>
> >> i also tried:
> >>
> >> $ sudo ./rebar install
> >> Password:
> >> ==> protobuffs (install)
> >> Installing: protobuffs-4 to /opt/local/lib/erlang/lib
> >> ==> riak-erlang-client (install)
> >> Installing: riakc-1 to /opt/local/lib/erlang/lib
> >> aqoon:riak-erlang-client khinester$ erl
> >> Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2]
> >> [async-threads:0] [hipe] [kernel-poll:false]
> >>
> >> Eshell V5.7.5  (abort with ^G)
> >> 1> code:which(riakc_pb_client).
> >> non_existing
> >> 2>
> >>
> >> how do i link the client correctly?
> >> any help much appreciated
> >>
> >> norman
> >>
> >> --
> >> ¿noʎ uɐɔ uʍop ǝpısdn ǝʇıɹʍ uɐɔ ı - %>>> "".join( [
> >> {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in
> >> ",adym,*)&uzq^zqf" ] )
> >>
> >> _______________________________________________
> >> riak-users mailing list
> >> riak-users at lists.basho.com
> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
> >
> >
>
>
>
> --
> ¿noʎ uɐɔ uʍop ǝpısdn ǝʇıɹʍ uɐɔ ı - %>>> "".join( [
> {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in
> ",adym,*)&uzq^zqf" ] )
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20100501/aedfb7bb/attachment.html>


More information about the riak-users mailing list