Hello Riak

http://docs.basho.com/riak/latest/quickstart/  http://riak.com.cn/riak/latest 

https://github.com/websterclay/pimp_my_riak/blob/master/doc/basic-client.txt 

QuickStart

安装Erlang

http://blog.csdn.net/lqg1122/article/details/7434310 

http://docs.basho.com/riak/latest/ops/building/installing/erlang/ 

 

安装Erlang的依赖包

sudo apt-get install build-essential libncurses5-dev libssl-dev m4 unixodbc unixodbc-dev freeglut3-dev libwxgtk2.8-dev xsltproc fop tk8.5 openssl

安装riak-2+版本目前官方不支持Erlang17版本建议使用官方封装的Erlang:

wget -c http://s3.amazonaws.com/downloads.basho.com/erlang/otp_src_R16B02-basho5.tar.gz  

tar zxvf otp_src_R16B02-basho5.tar.gz 

cd otp_src_R16B02-basho5 

./configure && make && sudomake install

 

源码安装Riak(X)

hadoop@hadoop:~/github $ git clone https://github.com/basho/riak.git

hadoop@hadoop:~/github $ cd riak

hadoop@hadoop:~/github/riak$ git branch -a

hadoop@hadoop:~/github/riak$ git checkout -b remotes/origin/2.0

hadoop@hadoop:~/github/riak$ make rel

./rebar get-deps

Uncaught error in rebar_core: {'EXIT',

                               {undef,

                                [{crypto,start,[],[]},

                                 {rebar,run_aux,2,[]},

                                 {rebar,main,1,[]},

                                 {escript,run,2,

                                  [{file,"escript.erl"},{line,747}]},

                                 {escript,start,1,

                                  [{file,"escript.erl"},{line,277}]},

                                 {init,start_it,1,[]},

                                 {init,start_em,1,[]}]}}

Makefile:19: recipe for target 'deps' failed

make: *** [deps] Error 1

解决办法http://stackoverflow.com/questions/25327575/building-riak-uncaught-error-in-rebar-core 

 

针对CentOS系列的SSL编译:

CFLAGS="-DOPENSSL_NO_EC=1"./configure && make && sudomake install

 

针对Ubuntussl编译选项:

./configure --enable-ssl

 

还是报错!! --> Ubuntu下直接使用deb包安装


二进制安装(√)

wget -c http://s3.amazonaws.com/downloads.basho.com/riak/2.0/2.0.2/ubuntu/trusty/riak_2.0.2-1_amd64.deb 

sudo dpkg -i riak_2.0.2-1_amd64.deb

hadoop@hadoop:~$ whereis riak

riak: /usr/sbin/riak /usr/lib/riak /etc/riak /usr/share/man/man1/riak.1.gz

hadoop@hadoop:~$ sudo riak start

Hello Riak_第1张图片

hadoop@hadoop:~$ sudo riak-admin test

Successfully completed 1 read/write cycle to '[email protected]'

 

hadoop@hadoop:~$ erl -name [email protected] -setcookie riak

Erlang R16B02-basho5 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.3  (abort with ^G)

([email protected])1> RiakNode = '[email protected]'.

([email protected])2> net_adm:ping(RiakNode).

([email protected])3> {ok, C} = riak:client_connect(RiakNode).

** exception error: undefined function riak:client_connect/1

([email protected])4> code:which(riak).

non_existing

 

hadoop@hadoop:~$ sudo riak attach

([email protected])1> RiakNode = '[email protected]'.

([email protected])2> net_adm:ping(RiakNode).

([email protected])3> {ok, C} = riak:client_connect(RiakNode).

{ok,{riak_client,['[email protected]',undefined]}}

 

hadoop@hadoop:~$ sudo riak console

([email protected])1> RiakNode = '[email protected]'.

'[email protected]'

([email protected])2> net_adm:ping(RiakNode).

pong

([email protected])3> {ok, C} = riak:client_connect(RiakNode).

{ok,{riak_client,['[email protected]',undefined]}}

([email protected])4> q().

ok

([email protected])5> [os_mon] memory supervisor port (memsup): Erlang has closed

[os_mon] cpu supervisor port (cpu_sup): Erlang has closed

 

hadoop@hadoop:~$ epmd -names

epmd: up and running on port 4369 with data:

name riaktest at port 33129


TODO:  Riak-Java-API

你可能感兴趣的:(Hadoop)