Quick setup local S3 Test Environment with RiakCS On Fedora 20/21


  1. Download Riak-1.4.10, Riak-cs-1.5.2 and stanchion-1.5.0 Fedora RPMs from Riak site,
    according to the document, this is the latest match versions up to now.
  2. Config Riak first,
    Add those lines to riak_kv and comment the old storage_backend config line.
    {add_paths, ["/usr/lib64/riak-cs/lib/riak_cs-1.5.2/ebin"]}, %% Here, it is /usr/lib64/ on Fedora {storage_backend, riak_cs_kv_multi_backend}, {multi_backend_prefix_list, [{<<"0b:">>, be_blocks}]}, {multi_backend_default, be_default}, {multi_backend, [ {be_default, riak_kv_eleveldb_backend, [ {max_open_files, 50}, {data_root, "/var/lib/riak/leveldb"} ]}, {be_blocks, riak_kv_bitcask_backend, [ {data_root, "/var/lib/riak/bitcask"} ]} ]}, Add this line to riak_core section, {default_bucket_props, [{allow_mult, true}]}Official document is here, http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Riak/ On Fedora 20, I met error with "systemctl start riak.service" and my workaround is put "Defaults:root !requiretty" in /etc/sudoers as it prompt sudo need tty. ON Fedora 21, I didn't occur this error and the system just prompt to use chkconfig to enable the riak service as it is old one. You can use both systemctl or service command to start/stop/status riak/riak.service on Fedora 21.
  3. Config Stanchion It is simple task just following the document, http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Stanchion/
  4. Follow this document to config riak-cs service http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Riak-CS/ use riak ping stanchion ping riak-cs ping To check those three services are up.  Before you create admin user, please confirm the {anonymous_user_creation, true} in /etc/riak-cs/app.config.
    I used this command to create the admin user,

    curl -H 'Content-Type: application/json'  -XPOST http://localhost:8080/riak-cs/user  --data '{"email":"foobar@example.com", "name":"admin user"}'

    After get the credential of Admin user, put the key and secret key to both /etc/stanchion/app.config and /etc/riak-cs/app.config files, also change  {anonymous_user_creation, true} to  {anonymous_user_creation, false} in /etc/riak-cs/app.config. Then restart stanchion and riak-cs.
    The official document seems missed the credential in /etc/stanchion/app.config one.
  5. Test the environment with s3cmd

    put the credential got in last step to s3cfg.
    Document is here.
    http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-an-S3-Client/

This is a simple guide and only for Fedora user to test S3 API on local. 

Comments

Popular posts from this blog

RPM Build Tips!

关于.rpmnew和.rpmsave文件

Linux block device commands