Opscode's Chef, MySQL Galera and Severalnines's ClusterControl

In the next following sections I'll be using Chef to deploy a MySQL Galera cluster on EC2 and then monitor and manage it using Severalnines's ClusterControl.

In the end we should have 5 nodes deployed:

* 1 Node with Chef Server and serving also as a Chef workstation using Chef v0.10.8
* 3 Nodes running MySQL Galera v5.5.23.6
* 1 Node running ClusterControl v1.1.28

The distribution used for the EC2 nodes in this post is Ubuntu Server 11.10 and the Chef version used is 0.10.8. 


Bootstrap latest version of Chef Solo on Debian/Ubuntu dists

#!/usr/bin/env bash
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
apt-get -y update
apt-get -y install opscode-keyring
apt-get -y upgrade
apt-get -y install chef


MongoDB Quick Start - Replica Sets and Sharding

Scaling out 1 node with Replica Set

If you already have a running mongod instance you first need restart it with --replSet

$ mongod --fork --rest --replSet mySetName --port 27017 --dbpath ~/Projects/db/data/mongo/r0 --logpath ~/Library/Logs/mongod-r0.log

Initialize the node via the mongo client

$ mongo
> rs.initiate()
        "info" : "Config now saved locally.  Should come online in about a minute.",
        "ok" : 1

This node is our Primary Node where read/write is done initially.

> db.messages.insert({City: "Tokyo"})
> db.messages.find()


tmux and irssi sitting in a tree...



# command prefix to ctrl+space
set -g prefix C-Space

# bindings
unbind-key C-b
bind-key a send-prefix
bind-key C-a last-window
bind s split-window -v
bind v split-window -h
bind-key Tab select-pane -t :.+
bind m command-prompt "split-window -h 'exec man %%'"
bind R source-file ~/.tmux.conf
bind k confirm-before "kill-window"
bind-key -r    M-Up resize-pane -U
bind-key -r  M-Down resize-pane -D
bind-key -r  M-Left resize-pane -L
bind-key -r M-Right resize-pane -R
bind-key -r    C-Up resize-pane -U 5
bind-key -r  C-Down resize-pane -D 5
bind-key -r  C-Left resize-pane -L 5
bind-key -r C-Right resize-pane -R 5

# status bar



Subscribe to Front page feed