Yury Pitsishin

33 posts

Persisting Application Configuration In Golang

I often observe that configuration is overlooked in books and posts devoted to application development. Authors only slightly touch it at best. I believe it's quite an important topic on its own and deserves a dedicated post. So in this post you will find explained examples of how to make persistent configurations in Go applications.

I will demonstrate how to work with configuration for two most popular formats: json and yaml. In examples we will store and load config of hypothetical cluster manager captured with the following structs:

type Cluster struct {  
    Name       string
    DataCentre string
    Nodes      []string
}

type Configuration struct
Read more »

Managing Cluster With Ansible Playbooks

While ad hoc commands are indispensable for learning Ansible and executing one time tasks, playbooks are real workhorses. In this introductory post I will explain the essence of a playbook on example.

So what is a playbook?

At the first glance, it's a file written in YAML that contains a list of plays. If we look closer, we'll see that a playbook file is a mixture of configuration and script concepts. On one hand, it specifies the desired configuration of systems. On the other hand, like in a script, it defines in which order tasks must be executed in a

Read more »

Understanding Ansible Patterns

Patterns is a set of expressions in Ansible that lets us specify concisely which systems a playbook or an ad hoc command must be applied to. In this post we will consider most useful pattern expressions and demonstrate them on examples.

In examples we will use module ping, which doesn't produce much output. If you never worked with it before, ping module just pings all systems selected by pattern. Also we will make use of -o option, which condenses output to one line per system.

In general, our ad hoc commands will look like:

ansible <pattern> -m ping
Read more »

Playing With Ansible Using Ad-Hoc Commands

In previous posts we created a cluster of VMs and set up Ansible to manage the cluster. So we have a cluster of VMs ready to play with. Today we will explore Ansible with a bunch of ad hoc commands, which is the easiest way to get a flavour of cluster management.

Ansible

Before going any further it's important to understand Ansible philosophy, because it drastically differentiates Ansible from similar tools.

In contrast to Puppet and other tools that automate execution of commands on remote systems, Ansible manages remote systems' state. In Ansible you specify a state that remote systems

Read more »

Client-Server Communication In Distributed Systems

In the previous post I've covered main concepts of Interprocess Communication (IPC). Today we will get familiar with client-server paradigm and common communication methods used for it: sockets, RPC and pipes.

Client-server

Client-server concept underpins distributed systems over a couple of decades. There are two counterparts in the concept: a client and a server. In practice there are often multiple clients and single server. Clients start communication by sending requests to the server, the server handles them and usually returns responses back.

Client processes often do not live long, while server process, which is sometimes called daemon, live till OS

Read more »