Kaffke.ws

Tutorials and other stuff.

Running Octopress on CoreOS

In this post I will report my experiences and the challenges I had to fight regarding my first steps to CoreOS

CoreOS is an operating system built to run docker containers with clustering and high availability in mind.

I will write a tutorial on setting up CoreOS clusters manually any time soon. For now I just assume you followed this Guide to have a 3 machine CoreOS Cluster on EC2.

Let’s start with the basics

While you just by some clicks should have a running CoreOS cluster now, let’s make sure you connect to it the right way:

You should check, if your ssh-agent has the right key

1
$ ssh-add -l

This should output your key. If it doesn’t, just add it by typing:

1
$ ssh-add ~/.ssh/<YOUR KEY>

and check again.

If everything is okay, then ssh into one of your instances via ssh

1
$ ssh core@<ip address>

Note: To interact with your CoreOS node, you have to use the `core` user.

Now you should be logged in. Yay!

Listing your machines

To list your machines in your cluster type:

1
$ fleetctl list-machines

Your output should look like this:

1
2
3
4
5
core@ip-172-31-20-92 ~ $ fleetctl list-machines
MACHINE   IP    METADATA
23bd9809... 172.31.2.187  -
3a27d588... 172.31.20.92  -
b427ca07... 172.31.20.93  -

In the first column you’ll see the abbreviated form of the hash representing your machine

the second one is the IP of that machine

and the third one contains metadata (if present)

You’ll probably be a little impatient, so we’ll start now by running a docker container:

1
2
3
4
5
6
7
8
9
10
core@ip-172-31-20-92 ~ $ sudo docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu' locally
Pulling repository ubuntu
5ba9dab47459: Download complete
511136ea3c5a: Download complete
27d47432a69b: Download complete
5f92234dcf1e: Download complete
51a9c7c1f8bb: Download complete
Status: Downloaded newer image for ubuntu:latest
root@a2bb40cdaf38:/#

Yay a command prompt of the newly created ubuntu container :-)

But that’S definetly not the way you want to run docker containers on CoreOS. Enter systemd and fleet.

systemd

Finally

I finally made it to get my own coding blog up and running.

What can I expect to read here?

Well, this is a blog about my life as a company owner / ceo and software developer as well as open source and technology enthusiast. I’m not focused on any specific topic and I’m not a native speaker so perhaps you’ll find some mistakes in my writings. As far as something is technically wrong, please feel free to leave a comment…