Skip to content
shinberg edited this page Jul 15, 2015 · 5 revisions

Quick Start

This document describes how to use vagrant to make virtual machine with ready to use redis cluster and cpp-hiredis-cluster with just a few commands

Initial Steps

This part describes how to install and make first initialization of virtual machine to run examples

  • Install vagrant in order to be able to run virtual machine
  • Clone cpp-hiredis-cluster library and cd to its folder
git clone git@github.com:shinberg/cpp-hiredis-cluster.git
cd cpp-hiredis-cluster/
  • Run vagrant up command to initialize and start virtual machine
vagrant up

first running of vagrant up command will prepare complete virtual machine with:

  • installed ready for use redis server in cluster mode with 3 nodes
  • builded cpp-hiredis-cluster examples which you can run

Now you can connect and run examples on virtual machine with Usage step

Usage

This part describes how to connect to virtual machine and run the examples of cpp-hiredis-cluster library

  • run vagrant ssh from cpp-hiredis-cluster directory
vagrant ssh
  • after ssh logins you can run examples from ~/build/bin directory insinde the vm, for example:
~/build/bin/sync

the output of example must be

 Reply to SET FOO BAR 
OK
  • you can change the source code of examples on your host machine and rebuild the examples from build directory on guest machine
cd build
make

Shutdown and restart

To shutdown and restart virtual machine you can run following commands from cpp-hiredis-cluster directory on host machine:

  • to shutdown a virtual machine you can run vagrant halt ot vagrant suspend command
  • to start virtual machine again you can run vagrant up command and connect again with vagrant ssh command
Clone this wiki locally