Updating a Maintainable NPM Module with Continuous Integration

Continuous Integration and Deployment with Codeship Continuous integration (CI) is one of those topics that might sound scary and complicated, and of course there are a gazillion aspects of it that could occupy you for years, but getting started doesn’t have to be a major undertaking. The idea of CI […]

How to reduce your PHP tests execution time up to 85%

We all know that a good test suite — unit and integration — is important to any application. We also know that running all our tests can take some time (especially in large projects). What one may not know is that is possible to reduce this time up to 85% […]

Implementing Domain-Driven Design for Microservice Architecture

services such as the order management service, the customer management service, etc. Services communicate using either synchronous protocols such as HTTP/REST or asynchronous protocols such as AMQP (Advanced Message Queuing Protocol). Services can be developed and deployed independently of one another. Each service has its database to be decoupled from […]

GlusterFS split-brain

Существует 3 типа split-brain 1.Data-spli-brain – информация в файлах отличается на разных кирипичиках реплики(т.е. разное содержимое файлов, находящихся в каталоге /gluster-storage на нодах) 2.Metadata-split-brain – аналогично,но не информация/содержимое отличается, а метаданные(группа,владелец,права,атрибуты) 3.Entry/gfid-split-brain – GlusterFS-иденитификаторы(GFID) различаются для одного и того же файла на разных кирпичиках одной реплики Entry/gfid — этот тип […]

Docker Swarm Cheatsheet

I’ve been studying docker-swarms lately and wanted to write a cheatsheet of setup and commands to maintain a swarm both for my reference and yours. These commands are for docker version: 17.03.0-ce as of August 2017. Install docker with curl -ssl https://get.docker.com | bash Preparing the server Create several instances […]

Nginx, Php-Fpm и что это вообще?

PHP-FPM — это разновидность SAPI для PHP. Чтобы понять, что это такое, стоит рассказать о понятии SAPI. FPM SAPI, он же Server API. В php есть несколько таких API для разных вариантов его работы: CLI SAPI — в качестве консольной команды `php` для запуска наших кронов и других cli-программ (Command […]

Enable sudo without password in Ubuntu/Debian

You probably know that in Ubuntu/Debian, you should not run as the root user, but should use the sudo command instead to run commands that require root privileges. However, it can also be inconvenient to have to enter your password every time that you use sudo. Here’s a quick fix […]

Swarm secrets made easy

A recent Docker update came with a small but important change for service secrets and configs, that enables a much easier way to manage and update them when deploying Swarm stacks. TL;DR This post describes an automated way to create and update secrets or configs, when they are managed through […]

Setup Highly Available applications with Docker Swarm and Gluster

# docker run hello-worldUnable to find image ‘hello-world:latest’ locallylatest: Pulling from library/hello-world1b930d010525: Pull completeDigest: sha256:92695bc579f31df7a63da6922075d0666e565ceccad16b59c3374d2cf4e8e50eStatus: Downloaded newer image for hello-world:latestHello from Docker!This message shows that your installation appears to be working correctly. 2. Initialize Docker swarm from the swarm-manager We’ll use the swarm-manager’s private IP as the “advertised address”. swarm-manager:~# […]

Generate /etc/hosts with Ansible

inventory file [servers] master ansible_ssh_host=172.18.23.69 node1 ansible_ssh_host=172.18.23.70 node2 ansible_ssh_host=172.18.23.71 node3 ansible_ssh_host=172.18.23.72 templates/etc/hosts.j2 {% for item in ansible_play_batch %} {{ hostvars[item].ansible_ssh_host }} {{ item }}.example.com {% endfor %} playbook task — hosts: servers gather_facts: False tasks: — name: update /etc/hosts file become: true blockinfile: dest: /etc/hosts content: «{{ lookup(‘template’, ‘templates/etc/hosts.j2’) }}» […]