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
?
針對Ubuntu的ssl編譯選項:
./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
hadoop@hadoop:~$?sudo?riak-admin?test
Successfully?completed?1?read/write?cycle?to?'riak@127.0.0.1'
?
hadoop@hadoop:~$?erl?-name?riaktest@127.0.0.1?-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)
(riaktest@127.0.0.1)1>?RiakNode?=?'riak@127.0.0.1'.
(riaktest@127.0.0.1)2>?net_adm:ping(RiakNode).
(riaktest@127.0.0.1)3>?{ok,?C}?=?riak:client_connect(RiakNode).
**?exception?error:?undefined?function?riak:client_connect/1
(riaktest@127.0.0.1)4>?code:which(riak).
non_existing
?
hadoop@hadoop:~$?sudo?riak?attach
(riak@127.0.0.1)1>?RiakNode?=?'riak@127.0.0.1'.
(riak@127.0.0.1)2>?net_adm:ping(RiakNode).
(riak@127.0.0.1)3>?{ok,?C}?=?riak:client_connect(RiakNode).
{ok,{riak_client,['riak@127.0.0.1',undefined]}}
?
hadoop@hadoop:~$?sudo?riak?console
(riak@127.0.0.1)1>?RiakNode?=?'riak@127.0.0.1'.
'riak@127.0.0.1'
(riak@127.0.0.1)2>?net_adm:ping(RiakNode).
pong
(riak@127.0.0.1)3>?{ok,?C}?=?riak:client_connect(RiakNode).
{ok,{riak_client,['riak@127.0.0.1',undefined]}}
(riak@127.0.0.1)4>?q().
ok
(riak@127.0.0.1)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
總結
以上是生活随笔為你收集整理的Hello Riak的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 思岚科技发布业内首款激光建图传感器Sla
- 下一篇: 单片机 SJMP