Extracting Riak "Example Servers" Chapter 2 of Seven Database in Seven Weeks

252 views Asked by At

I recently started reading 7 databases in 7 weeks to try to broaden expand my knowledge. I have been stuck at the beginning of the first RIAK chapter for awhile. I'm trying to figure out how to extract the example servers from the source since i have installed the binaries on Ubuntu. The first commands that I'm supposed to run use the example servers:

dev/dev1/bin/riak start
dev/dev2/bin/riak start
dev/dev3/bin/riak start

When I look in the source I don't see anything that appears to be this so not really sure what I'm looking for.

Officially the authors wanted me to build RIAK but they are using 1.0.2 which I couldn't find a version of Erlang to build. I also tried building the latest and I ran into this:

snappy-test.cc: At global scope:
snappy-test.cc:82:15: error: aggregate ‘snappy::rusage       
snappy::benchmark_start_cpu’ has incomplete type and cannot be defined 
struct rusage benchmark_start_cpu;

Edit the version of the binaries I installed is:

riak version
2.1.1

I also have the source files for 1.0.2 and the latest version of trunk from Github from 6/5/2015 Probably like 10pm.

2

There are 2 answers

2
mbb On

I don't have the directions for the book, but I know it's out of date for building Riak KV. The latest how-to for Ubuntu is kept up-to-date here.

A few tips:

  • You can find wherever Riak KV is running by hunting down the beam process: ps aux | grep beam
  • If you want to download any pre-built package by Basho, you can find them on PackageCloud

If your goal is to get to playing around with Riak in a real-to-world way, installing from PackageCloud is what we do.

0
Turiphro On

Another way is running Riak (KV) in Docker:

docker run -it --rm -e CLUSTER_NAME=riakkv basho/riak-kv

Additional nodes will need to know the COORDINATOR_NODE.

A full cluster can be simulated in Docker Compose. See this example from:

https://hub.docker.com/r/basho/riak-kv/

version: "2"
services:
  coordinator:
    image: basho/riak-kv
    ports:
      - "8087:8087"
      - "8098:8098"
    environment:
      - CLUSTER_NAME=riakkv
    labels:
      - "com.basho.riak.cluster.name=riakkv"
    volumes:
      - schemas:/etc/riak/schemas
  member:
    image: basho/riak-kv
    ports:
      - "8087"
      - "8098"
    labels:
      - "com.basho.riak.cluster.name=riakkv"
    links:
      - coordinator
    depends_on:
      - coordinator
    environment:
      - CLUSTER_NAME=riakkv
      - COORDINATOR_NODE=coordinator

volumes:
  schemas:
    external: false

I was struggling to find ready to use examples myself, so people reaching this post might be interested in this repo with Docker Compose examples that I created, including scripts and example data.