A Vagrant project to bring up a local Datomic instance backed by Riak.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
roles
.gitignore
Berksfile
CHANGELOG.md
README.md
Vagrantfile

README.md

vagrant-datomic-riak

This is a Vagrant project powered by Chef to bring up a local Datomic instance backed by Riak.

Configuration

Install Vagrant

Download and install Vagrant via the Vagrant installer.

Install Vagrant plugins

$ vagrant plugin install vagrant-berkshelf
$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-cachier

Running

Clone project repository

$ git clone https://github.com/hectcastro/vagrant-datomic-riak.git
$ cd vagrant-datomic-riak

Launch cluster

$ export DATOMIC_LICENSE_KEY="..."
$ export DATOMIC_LICENSE_EMAIL="hector@basho.com"
$ # Get this from: https://my.datomic.com/account
$ export DATOMIC_LICENSE_DOWNLOAD_KEY="e5d112c4-c3d7-11e3-9bbe-1a514932ac01"
$ DATOMIC_RIAK_CACHE=1 vagrant up

Environmental variables

  • DATOMIC_RIAK_NODES – The number of node you want to spin up (default: 1)
  • DATOMIC_RIAK_OS – The operating system you want to use (CENTOS or UBUNTU, default: CENTOS)
  • DATOMIC_RIAK_CACHE – Whether you want to allow Vagrant to use the vagrant-cachier plugin or not (default: false)
  • DATOMIC_LICENSE_KEY – The Datomic Pro license key
  • DATOMIC_LICENSE_EMAIL – E-mail address associated with your Datomic account
  • DATOMIC_LICENSE_DOWNLOAD_KEY – A key used for authentication when automating the download of Datomic

Testing

Install the Datomic Pro peer library

$ unzip datomic-pro-0.9.4360.zip
$ cd datomic-pro-0.9.4360
$ ./bin/maven-install

Run test project

$ git clone https://github.com/hectcastro/vagrant-datomic-riak-test.git
$ cd vagrant-datomic-riak-test
$ sed -i.bak "s/:username \"\"/:username \"${DATOMIC_LICENSE_EMAIL}\"/" project.clj
$ sed -i.bak "s/:password \"\"/:password \"${DATOMIC_LICENSE_DOWNLOAD_KEY}\"/" project.clj
$ lein run

A successful run should return something like this:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/hector/.m2/repository/org/slf4j/slf4j-nop/1.7.5/slf4j-nop-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/hector/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
#<promise$settable_future$reify__4417@ed80876: {:db-before datomic.db.Db@da5ca3f3, :db-after datomic.db.Db@4b163359, :tx-data #<ArrayList [datomic.db.Datum@fc751ce5, datomic.db.Datum@ce599ea2]>, :tempids {-9223350046623220288 17592186045417}}>
#<HashSet [[17592186045417]]>
{:db/doc Hello world, :db/id 17592186045417}
{:db/ident :db/doc, :db/valueType :db.type/string, :db/cardinality :db.cardinality/one, :db/fulltext true, :db/doc Documentation string for an entity., :db/id 62}

Vagrant box

The Vagrant box used in this project was created by Packer. To view the Packer template, click here.