0

I am going through the riak-erlang-client https://github.com/basho/riak-erlang-client. As i am following the steps, i am facing error at storing the data.

I did the following:

2> {ok,Pid} = riakc_pb_socket:start_link("127.0.0.1",8087).
{ok,<0.35.0>}
3> 
3> 
3> riakc_pb_socket:ping(Pid).
pong
4> Val = 1.                                         
1
7> Obj = riakc_obj:new(<<"Bucket">>,<<"one">>,Val). 
{riakc_obj,<<"Bucket">>,<<"one">>,undefined,[],undefined,1}

everything was working here as per the documents, but when i am trying to store the data with the following command.

 8> riakc_pb_socket:put(Pid,Obj).

After this command i am getting the following error,

=ERROR REPORT==== 13-May-2014::18:15:46 ===
** Generic server <0.35.0> terminating 
** Last message in was {req_timeout,#Ref<0.0.0.60>}
** When Server state == {state,"127.0.0.1",8087,false,false,undefined,false,
                           gen_tcp,undefined,
                           {[],[]},
                           1,[],infinity,undefined,undefined,undefined,
                           undefined,[],100}
** Reason for termination == 
** disconnected
** exception exit: disconnected

where i am doing wrong, please suggest me.

Krish gopi
  • 155
  • 4
  • 12

1 Answers1

1

That error means that your TCP request timed out for some reason. Is there anything in Riak's error.log or console.log files that could tell you why?

Can you test to see if your Riak node is running by going to http:127.0.0.1:8098/ping in a browser?

If it's up and running you can try your test again by either clearing your currently bound variables with f(). (or opening a new Erlang REPL), and retrying the commands.

Alex Moore
  • 3,415
  • 1
  • 23
  • 39
  • I have done it but again it is showing the same thing, the error in the logs was like the following: 2014-05-13 20:29:05.563 [error] emulator Error in process <0.7602.0> on node 'riak@127.0.0.1' with exit value: {emfile,[{erlang,open_port,[{spawn,"/home/intel/Downloads/riak-1.4.8/rel/riak/bin/../lib/os_mon-2.2.7/priv/bin/cpu_sup"},[stream]]},{cpu_sup,start_portprogram,0},{cpu_sup,port_server_init,1}]} – Krish gopi May 13 '14 at 15:08
  • Ahh you're running into the `EMFILE` error, you'll need to increase your open files limit on your operating system as outlined in the docs: http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/#Linux. – Alex Moore May 14 '14 at 14:48
  • @gopi Did you adjust your `ulimit` settings and get around this problem? – Alex Moore May 16 '14 at 04:01
  • ya when i go for ulimit it was giving unlimited to, even i again set ulimit as 4096 – Krish gopi May 16 '14 at 15:27
  • 2014-05-16 20:53:10.717 [info] <0.398.0>@riak_kv_entropy_manager:perhaps_log_throttle_change:826 Changing AAE throttle from undefined -> 0 msec/key, based on maximum vnode mailbox size 0 from 'dev3@127.0.0.1' – Krish gopi May 16 '14 at 15:41
  • What Operating System are you running @gopi? – Alex Moore May 16 '14 at 18:09
  • I am using Centos @Alex Moore – Krish gopi May 17 '14 at 07:43
  • @gopi You will probably have to change it using the `/etc/security/limits.conf` method. See the [Linux / limits.conf](http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/#Linux) section on how to do it. – Alex Moore May 19 '14 at 16:14