Clickhouse multi master replication


File for reproductible environment :

Nothing is stored on the VM instances : see volumes configuration out of the docker-compose file.

Sharding and replica is straightforward and defined in these files :

  • ch_configs/config.d/remote_server.xml
  • ch-configs/macros_chX.xml (replace X with server’s instance number)

Starting clickhouse servers :

$ docker-compose up -d ch1 ch2 ch3 ch4

$ docker ps -a

To use it either use any client you prefer (Tabix, …) or connect with the client (already defined in docker-compose file):

$ docker-compose run –rm client –host ch1 –user quid –password quid

3d8fccb51750 🙂 SELECT * FROM system.clusters

Database and tables creation

CREATE DATABASE todos_cluster on cluster todos;


show tables from todos_cluster

This database has been replicated on all the shards/replicas, no tables are yet existing

The name of the cluster can be found in this file : ch_configs/config.d/remote_server.xml with the tag <todos>

Local table

To create tables where content will only be replicated with its replica :

You can check on each server (ch1, ch2, ch3, ch4) if the tatble is created

Now let’s insert data

INSERT INTO todos_cluster.events_local VALUES(1, ‘2020-03-28 00:00:00’, 3, ‘Hit the road Jack’, ‘2020-04-15 00:00:00’);

select * from todos_cluster.events_local;

Distributed tables

To create tables where content will be replicated in all shards :

Use show tables on all instances to see it has been created.

Now we insert data inside this table

INSERT INTO todos_cluster.events_distributed VALUES(2, ‘2020-03-28 00:00:00’, 4, ‘Sweig – Le joueur d\’échec’, ‘2020-05-05 00:00:00’);

INSERT INTO todos_cluster.events_distributed VALUES(3, ‘2020-03-28 00:00:00’, 1, ‘Kitchen’, ‘2020-03-30 00:00:00’);

INSERT INTO todos_cluster.events_distributed VALUES(4, ‘2020-03-28 00:00:00’, 3, ‘Muse Hysteria’, ‘2020-04-25 00:00:00’);

select * from todos_cluster.events_distributed

3 minutes Icescrum server with docker on Debian Jessie


Connected as root :

Update repo

apt-get update
apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl software-properties-common

Get docker repo

curl -fsSL | sudo apt-key add -
add-apt-repository "deb debian-$(lsb_release -cs) main"

Re-update depo

apt-get update

Install docker

apt-get -y install docker-engine

Keep reading

3 minutes SVN server


Install a debian server

apt-get update
apt-get install -y subversion
mkdir /srv/SVN

cat > /etc/init.d/svnserve << "EOF"

do_start () {
	svnserve -d -r /srv/SVN --pid-file /var/run/
do_stop () {
	start-stop-daemon --stop --quiet --pidfile /var/run/

case "$1" in
 		exit $?
		sleep 1s
		echo "Error: argument '$1' not supported" >&2
		exit 3
		echo "Usage: $0 start|stop|restart" >&2
		exit 3

chmod +x /etc/init.d/svnserve
update-rc.d svnserve defaults

Create a repo

svnadmin create /srv/SVN/repo

Assign access

vi /srv/SVN/repo/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
vi /srv/SVN/repo/conf/passwd
login = password

Now start server : /etc/init.d/svnserve start

Done !

To connect, checkout :

svn://<ip adresse>/repo

The end

Android, NodeJS, Openshift, Twilio



Ahoy-hoy !

Duration of this tutorial : >2h hours

What will you learn

At the end of this lesson you’ll be able to develop, sign and package an Android application that communicates with a Node.JS application deployed on Openshift cloud provider, that serves SMS via Twilio’s API

This is a step by step tutorial, I try to cover every single operation from folders’ creation to packaging.

Keep reading

Du travail d’architecte


La plupart des personnes que je rencontre, ont une vision très technique du travail d’un architecte et n’ont pas forcément conscience de l’importance que doit revêtir la place de l’humain dans notre réflexion et nos décisions.
Je vais m’attarder dans ce billet surtout au travail de fond, conjoint avec les développeurs que l’architecte doit engager, tant il est évident qu’un architecte se doit de connaitre toutes les ressources mises à sa disposition et ou susceptible de le devenir.
Une partie de ce travail est parfois similaire à celui que devrait faire un ‘bon’ (troll inside) chef de projet Keep reading

  • 1
  • 2
  • 6