1. Basho
  2. Untitled project
  3. riak_search


riak_search / TRANSITION.org

#+OPTIONS: author:nil timestamp:nil

Migrating from Riak 0.9.x to 0.10

* Overview
  Riak has undergone significant restructuring in the transition from
  version 0.9.x to version 0.10.  If you are using the binary builds,
  please skip directly to the Configuration and Clients sections.  If
  you are building from source yourself, please review the whole of
  this document.

  NOTE: If the only files you have changed in your Riak source clone
  are those underneath the "rel" directory
  ("rel/overlay/etc/app.config", for example), the safest way to
  update is to make a fresh clone of the Riak repository, and then
  skip to the Configuration and Clients sections of this document for
  details about migrating your configurations and data.

* Requirements

** Erlang/OTP R13B04

   Riak 0.10 uses new features ("NIFs") provided by the latest
   Erlang/OTP release, R13B04.  If you are building from source, you
   will need this release or a newer one.

** Mercurial

   Riak 0.10 has moved several of its components into external
   repositories.  If you are building from source, you will need
   Mercurial installed to allow the Rebar build system to retrieve
   code from these external repositories.

* Dependencies

** Mochiweb, Webmachine, Erlang_js
   mochiweb, webmachine, and erlang_js are now pulled into the "deps"
   subdirectory, instead of being included in the "apps" subdirectory.
   If you are pulling 0.10 code into a repository that formerly had
   0.9.x in it, please remove the apps/mochiweb, apps/webmachine, and
   apps/erlang_js directories from your source tree.

   There is a chance that your update will also leave an "apps/riak"
   directory hanging around.  If it does, please remove this directory
   (Riak code has moved into the "apps/riak_core" and "apps/riak_kv"

** make deps
   The "all" make target (and, by extension, the "rel" target as
   well), depend on a new "deps" target, which handles the fetching
   the dependencies (mochiweb, webmachine, erlang_js).

* Source

** Core/KV Split
   We've drawn a line through 0.9.x Riak, and divided it into two
   things, one called "riak_core", and the other called "riak_kv".

   The things that live in riak_core are those that deal with cluster
   membership.  Ring-claiming and the like.

   The things that live in riak_kv are those that deal with storing
   data.  Get and Put FSMs, backends, etc.

** Clients
   We've also moved the clients out of the client_lib subdirectory,
   and into their own language-specific repositories on BitBucket.  At
   http://bitbucket.org/basho/, you should find:

   + riak-python-client
   + riak-php-client
   + riak-erlang-client
   + riak-java-client
   + riak-javascript-client
   + riak-ruby-client

* Configuration

** app.config

  Splitting the "riak" Erlang application into the "riak_core" and
  "riak_kv" Erlang applications means that configuration options for
  each component need to move around in etc/app.config.

  Where before etc/app.config would have contained a section like:

  {riak, [
           %% many settings here

  Now, etc/app.config should contain two sections like:

  {riak_core, [
               %% core-specific settings
  {riak_kv, [
             %% kv-specific settings

  The list of settings that moved to the riak_core section are:

  + choose_claim_fun 
  + cluster_name - string, defaults to "default"
  + default_bucket_props 
  + gossip_interval - integer, defaults to 60k msec
  + ring_creation_size - integer, defaults to 64
  + ring_state_dir - string
  + target_n_val - integer, defaults to 3
  + wants_claim_fun
  + web_ip - string. Used to be "riak_web_ip"
  + web_logdir - string.
  + web_port - integer. Used to be "riak_web_port"

  IMPORTANT: Note the rename of "riak_web_*" to just "web_*"

  The list of settings that moved to the riak_kv section are:

  + add_paths - list, defaults to []
  + handoff_concurrency - integer, defaults to 4
  + js_source_dir - string
  + js_vm_count - integer
  + mapred_name - string
  + raw_name - string
  + riak_kv_stat - boolean.
  + stats_urlpath - string
  + storage_backend - atom. Backend names are now prefixed as "riak_kv_" instead of just "riak_".
  + pb_ip - string
  + pb_port - integer

  IMPORTANT: The default backend has changed names from
  riak_dets_backend to riak_kv_dets_bakend.  Other backends have
  changed names as well.  This rename does not affect you if you are
  using the Innostore backend.

  If you did not have any of these settings defined in etc/app.config,
  you still do not need to define them in your new etc/app.config.

** Ring Storage
   Periodically, Riak nodes save the state of their ring to disk.  In
   0.9, these files were named "data/ring/riak_ring.*", but in 0.10,
   they're named "data/ring/riak_core_ring.*".  Renaming the old files
   to the new scheme is all you need to do to make the switch.

   If you referenced any Riak modules in your bucket properties, you
   will also need to change those references to point to the new
   module names after your cluster is running.

** Your Data
   The rest of your cluster's data, stored in the "data" directory
   ("data/dets" or "data/innodb", for example)
   should be safe to either leave in place, or copy to your new
   install location, depending on how you upgraded.