How to set up a CoreOS cluster on Ubuntu server
Index:
Step 1: Install Vagrant and VirtualBox (can be VMWare)
Step 2: Clone coreos-vagrant repository
Step 3: Config and start a cluster
Step 1: Install Vagrant and VirtualBox (can be VMWare)
CoreOS, Linux for Massive Server Deployments.CoreOS is a new Linux distribution that has been re-architected to provide features needed to run modern infrastructure stacks. The strategies and architectures that influence CoreOS allow companies like Google, Facebook and Twitter to run their services at scale with high resilience.
First of all, let's download some virtualization providers to run CoreOS.We are going to use VirtualBox/Vagrant to virtualize your cluster.
Type this to start:
$ sudo apt-get update && sudo apt-get dist-upgrade -y
if, you are under a corporative proxy, you may not have connection to internet, so make sure your proxy is well configured.VirtualBox
Type:
$ sudo vim /etc/apt/sources.list
Note: type letter " i " to edit
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
deb http://download.virtualbox.org/virtualbox/debian saucy contrib
deb http://download.virtualbox.org/virtualbox/debian raring contrib
deb http://download.virtualbox.org/virtualbox/debian quantal contrib
deb http://download.virtualbox.org/virtualbox/debian precise contrib
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
Then save.
Note: press ":wq" then "enter" w: write, q: quit
The Oracle public key for apt-secure can be downloaded and set it with the following command:
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
To install VirtualBox:
$ sudo apt-get update && sudo apt-get install virtualbox-4.3
Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade. For Debian it is available in Lenny backports and in the normal repository for Squeeze and later. The dkms package can be installed through the Synaptic Package manager or through the following command:
$ sudo apt-get install dkms
This is the same as the steps above, let's say "the short answers"
$ echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" | sudo tee -a /etc/apt/sources.list > /dev/null wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -$ sudo apt-get update$ sudo apt-get install linux-headers-3.13.0-35-generic -y$ sudo apt-get install virtualbox-4.3 -y$ sudo /etc/init.d/vboxdrv setup
Then we should reboot our server
$ sudo reboot
Vagrant
Just type:
$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.1_x86_64.deb
$ sudo dpkg --install vagrant_1.7.1_x86_64.deb
$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.1_i686.deb
$ sudo dpkg --install vagrant_1.7.1_i686.deb
That is going to take a few minutes. Once the process had finished, you should be able to run the Vagrant and VirtualBox binaries.
Let's try them:
$ vboxmanage -v && vagrant --version
Make sure you have the correct version for each:
- VirtualBox 4.3 or greater
- Vagrant 1.6.3 or greater
Step 2: Clone coreos-vagrant repository
Let's try them:
$ sudo git clone https://github.com/coreos/coreos-vagrant.git
$ cd coreos-vagrant
Step 3: Config and start a cluster
user-data.sample
config.rb.sample
CoreOS is designed to be updated automatically with different schedules per channel. Select the channel you'd like to use for this cluster below:
Stable
The Stable channel should be used by production clusters. Versions of CoreOS are battle-tested within the Beta and Alpha channels before being promoted. Current version is CoreOS 494.5.0.Rename the file to config.rb then uncomment and modify:
config.rb
# Size of the CoreOS cluster created by Vagrant
$num_instances=3
# Official CoreOS channel from which updates should be downloaded
$update_channel='stable'
Beta
The beta channel consists of promoted alpha releases. Current version is CoreOS 522.2.0.
Rename the file to config.rb then uncomment and modify:
config.rb
Rename the file to config.rb then uncomment and modify:
config.rb
# Size of the CoreOS cluster created by Vagrant
$num_instances=3
# Official CoreOS channel from which updates should be downloaded
$update_channel='beta'
Alpha
The alpha channel closely tracks master and is released to frequently. The newest versions of docker, etcd and fleet will be available for testing. Current version is CoreOS 540.0.0.
Rename the file to config.rb and modify a few lines:
config.rb
# Size of the CoreOS cluster created by Vagrant
$num_instances=3
# Official CoreOS channel from which updates should be downloaded
$update_channel='alpha'
Start Machines Using Vagrant's default VirtualBox Provider
Start the machine(s):
$ sudo vagrant up
List the status of the running machines:$ sudo vagrant status
Connect to one of the machines:$ sudo vagrant ssh core-01 -A
If you can't connect to the virtual machines, you may have not configure the 64-bit virtualization extensions. To turn on this option try this:
On bare metal:
- Press LEFT-SHIFT to enter to BIOS
- Look for "enabiling 64-bit virtualization" or look for "VT-x", they are the same thing.
- Reboot
On VMWare:
- Power off vmware vitrual machine.
- Go to "edit virtual machine settings"
- Go to processors. There are three checkboxes there.
- Check second checkbox (enable VT-x/AMD-V)
- Power on machine.
- Power off VB vitrual machine.
- Go to "edit virtual machine settings"
- Go to system. There are three tabs there.
- Go to acceleration tab then (enable VT-x/AMD-V)
- Power on machine.
Start Machines Using Vagrant's VMware Provider
If you have purchased the VMware Vagrant provider, run the following commands:$ sudo vagrant up --provider vmware_fusion
$ sudo vagrant ssh core-01 -A
Cheers :)
Comments
Post a Comment