Skip to content

Latest commit

 

History

History
163 lines (138 loc) · 4.74 KB

quick-start.md

File metadata and controls

163 lines (138 loc) · 4.74 KB

Quick start

This guide demonstrates single machine setup of nbase-arc cluster. Please refer to Admin Guide for how to install multi-machine, fault-tolerant cluster.

Build

Build Requirements

Install these dependencies prior to building nbase-arc.

Build & Copy release binaries

# Change directory to your workspace.
$ cd $WORKSPACE

$ git clone https://github.com/naver/nbase-arc.git
$ cd nbase-arc

# Build nbase-arc release binaries.
$ make release
# ... ...

# Copy release binaries to $HOME directory.
$ cp -r release/nbase-arc $HOME

Setup nbase-arc zone

Install Configuration Master

Install & Run Apache Zookeeper 3.4.5 or 3.4.6

Set properties of Configuration Master

  • In properties, do not use {machine IP} as "localhost" or "127.0.0.1". Instead, use machine's actual IP.
$ cd $HOME/nbase-arc/confmaster

# Open cc.properties file and modify following properties
confmaster.ip={machine IP}
confmaster.zookeeper.address={zookeeper address}

Run Configuration master

$ cd $HOME/nbase-arc/confamster
$ ./confmaster-<version>.sh

# Send cm_start command to Configuration master
$ echo cm_start | nc {machine IP} 1122
{"state":"success","msg":"+OK"}

Install mgmt tool

Install Python & Fabric library

Set properties of mgmt tool

  • In properties, do not use {machine IP} as "localhost" or "127.0.0.1". Instead, use machine's actual IP.
  • {username} is an account where your cluster will be installed. For quick start, use current user.
$ cd $HOME/nbase-arc/mgmt/config

# Open conf_mnode.py file and modify following properties
CONF_MASTER_IP = "{machine IP}"
CONF_MASTER_PORT = 1122
CONF_MASTER_MGMT_CONS = 1
USERNAME = "{username}"

Specify deploy binaries

  • Nbase-arc's binaries are postfixed with version, like redis-arc-<version>.
$ cd $HOME/nbase-arc/mgmt/config

# Open conf_dnode.py file and modify following properties
REDIS_VERSION = "<version>"
GW_VERSION = "<version>"
SMR_VERSION = "<version>"

Create nbase-arc cluster

Set up ssh connection

  • Mgmt tool deploys clusters via SSH. For convenience, you can set up ssh authorization by public key.
# Generate SSH key if it doesn't exist already.
$ ssh-keygen
# ... ...

# Append generated public key to SSH's authorized_keys file
$ cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

Execute mgmt tool

# Execute mgmt tool
$ cd $HOME/nbase-arc/mgmt
$ fab main

=======================================
1. Show cluster information
2. Upgrade PGS
3. Upgrade GW
4. Install Cluster
5. Install PGS
6. Install GW
7. Uninstall Cluster
8. Uninstall PGS
9. Uninstall GW
10. Add replication
11. Leave replication
12. Migration
13. Repair Cluster (Cluster already installed)
14. Deploy bash_profile
x. Exit
=======================================
>>

Deploy shell profile

# Select "Deploy bash_profile". Then, input machine's actual IP
>> 14
PM information('ip list' or all) {machine IP}
... ...

Create nbase-arc cluster

  • PGS Physical Machine list is list of replica groups where a replica group is list of machines. Since we use only one machine in this guide, input format is like [["{machine name} {machine ip}"]].
    Ex) [["machine1 11.22.33.44"]]
  • Gateway Physical Machine list is list of machines where gateway will be installed. Usually, Gateway and PGS share same machine. In this guide, input format is like ["{machine name} {machine ip}"].
    Ex) ["machine1 11.22.33.44"]
# Select "Install Cluster".
>> 4
Cluster name : test_cluster
PG count : 4
Replication number : 1
PGS Physical Machine list([["PM_NAME PM_IP", "PM_NAME PM_IP"], ["PM_NAME PM_IP", "PM_NAME PM_IP"], ...]) [["{machine name} {machine IP}"]]
Gateway Physical Machine list([PM_NAME PM_IP, PM_NAME PM_IP, ...]) ["{machine name} {machine IP}"]
Cronsave number 1
Print script? [Y/n] Y
Print configuration? [Y/n] Y
Create PGS, Continue? [Y/n] Y
Confirm Mode? [Y/n] n
... ...

Test cluster using arc-cli

$ cd $HOME/nbase-arc/bin

$ ./arc-cli-<version> -z {zookeeper address} -c test_cluster
    _   ______  ___   _____ ______   ___    ____  ______   ________    ____
   / | / / __ )/   | / ___// ____/  /   |  / __ \/ ____/  / ____/ /   /  _/
  /  |/ / __  / /| | \__ \/ __/    / /| | / /_/ / /      / /   / /    / /
 / /|  / /_/ / ___ |___/ / /___   / ___ |/ _, _/ /___   / /___/ /____/ /
/_/ |_/_____/_/  |_/____/_____/  /_/  |_/_/ |_|\____/   \____/_____/___/

test_cluster> set test_key test_val
+OK
test_cluster> get test_key
"test_val"