How to set up a 3-node CoreOS cluster, just for fun

VirtualBox CoreOS cluster

“CoreOS is a new Linux distribution that has been rearchitected to provide features needed to run modern infrastructure stacks.”

That’s geek-speak for a Linux distribution that makes it (not-so-) super easy to run fun things like Linux containers and containerized applications on commodity hardware. That’s one of the trending things in the business, and it’s the kind of stuff I love to play it, even if just for the heck of it.

CoreOS just makes it easy to set up such systems, though it is not the only solution. CoreOS is derived from Chrome OS, with added functionality for server- and cluster-type installations.

To use CoreOS, you need to have VirtualBox and Vagrant installed. Other virtualization technologies are also supported, but the combination of VirtualBox and Vagrant seems, to me, to be the easiest to set up. Since I’m running Fedora 20, which has the latest version of VirtualBox in its repository, all I needed to install it, was type: yum install VirtualBox. To install Vagrant, download the RPM file from here. You can either save it to the Downloads directory and install it using yum from the command line, or open it in Apper, the graphical package manager, which will do the installation for you.

With those two installed, time to install (git clone) CoreOS itself, a task that has to be completed from the command line. So fire up a shell terminal, and also be sure to start VirtualBox. Then, type: git clone https://github.com/coreos/coreos-vagrant.git. After that, there should be a coreos-vagrant directory. Change into that directory (cd coreos-vagrant). An ls of that directory should show four files. Two of them should be named user-data.sample and config.rb.sample. Copies of tThose two will have to be modified a bit before the cluster is created.

Related Post:  Install ROSA Launcher on Fedora 18 KDE

Make a copy of user-data.sample and name it user-data (cp user-data.sample user-data). For the other file, name its copy config.rb (cp config.rb.sample config.rb). Open config.rb (nano -w config.rb) and look for the line that reads: #$num_instances=1. Uncomment it and change 1 to 3 so that it reads: $num_instances=3. That just defines the number of members in the cluster. Optionally, you may also uncomment the line that reads: #$vb_gui = false to $vb_gui = true. Making that change will just ensure that when the cluster is started, each member will have a graphical VirtualBox interface started. Not necessary, but it won’t break anything.

Then, open user-data (nano -w user-data and uncomment the #discovery: https://discovery.etcd.io/ line, so that it reads: discovery: https://discovery.etcd.io/. You will have to replace the part of that URL with a real token, which you can generate from https://discovery.etcd.io/new. That URL is the etcd discovery URL that’s used to start the cluster and elect an etcd leader. etcd is a “highly-available key value store for shared configuration and service discovery.” etcd and fleet, a distributed init system, are two services used to start and manage a CoreOS cluster. Fleet is a cluster-level version of systemd.

After generating the token, replace the in the discovery URL with the real token, so that it reads something like: discovery: https://discovery.etcd.io/9b090745ad1f48344e8fd004a293067c. With all that out of the way and assuming that you’re still in the coreos-vagrant directory, bring up the cluster by typing: vagrant up. You should see messages of the sort shown in this screenshot as each member of the cluster is created.
CoreOS vagrant create cluster

Related Post:  Manual disk partitioning guide for Kubuntu 11.04

As each member is created, you should also see a VirtualBox interface open. By default, you will not be able to do anything through them, since logging in is via SSH private keys. However, if you create a user and set a password, you will be able to log in via the VirtualBox interface, though that is really not necessary.
CoreOS VirtualBox cluster members

After creation of the cluster has been completed, you may type: vagrant ssh-config to see the SSH configuration details for each member. To log into any member, type: vagrant ssh , where is the hostname of a cluster member. So in the example shown in this screenshot, I logged into the first member using: vagrant ssh core-01
CoreOS cluster members

In VirtualBox, you see each member listed, just like on this screenshot.
VirtualBox CoreOS cluster

If you have gone this far, what you have just created is really an empty cluster set, where each member is like a minimal installation of your favorite Linux distribution. So play around with your cluster, become familiar with the vagrant commands; type vagrant -h to see the list of available commands. Inside a cluster member, become familiar with the etcdctl and fleetctl management utilities. To bring down the cluster, type: vagrant halt. Next: How to transform each cluster member into a complete Linux distribution. Stay tuned.

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer run network ads?  Yep, no more ads from the usual suspects that track and annoy you across the Internet. But since I still need to pay to keep the site running, feel free to make a small donation by PayPal or your favorite cryptocurrency.

  • Bitcoin
  • Ethereum
  • Xrp
  • Bitcoin cash
  • Bitcoin sv
  • Litecoin
  • Binance coin
  • Cardano
  • Ethereum classic
Scan to Donate Bitcoin to bc1qzvlte2m224zkayhdc7fdfjkp2rsgt0l5a496ua

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x0F4362DFF77F3Ba0Dc637F5f3Eba35D09a2fA60C

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Xrp to r4ggjvL36njsMCYTkJ3S7cTHscPsMsSGQv

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Bitcoin cash to qrs0dedzp9t55af3nfwypydghp29r0xguy9s20fz2k

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Bitcoin sv to 15K9TLyVDBtLuG9cYvXCX9SSkq9C9oUKHK

Donate Bitcoin sv to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin sv

Scan to Donate Litecoin to LetJ9QQMb7u2LMZ9Tu6rtHwcBcQFW98fbG

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Binance coin to bnb1ga8trq08ssqepd90v6225nzfgy448pu5pw8gxp

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Cardano to addr1qx2354yw49etstfljpdhwja3ajjlt487lg95vu9ngy2q6vu4rf2ga2tjhqknlyzmwa9mrm997h20a7stgectxsg5p5esq5l7d9

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Ethereum classic to 0xcD6CC972a2297FcafACDcfE042C55C69516a9264

Donate Ethereum classic to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum classic

Subscribe for updates. Trust me, no spam!

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Upcoming events

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest

On social media
Via my newsletter

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.