· Nov 19, 2020 3m read

Deploying a sharded cluster with Docker and MergeCPF

In this article, we will run an InterSystems IRIS cluster using docker and Merge CPF files - a new feature allowing you to configure servers with ease.

On UNIX® and Linux, you can modify the default iris.cpf using a declarative CPF merge file. A merge file is a partial CPF that sets the desired values for any number of parameters upon instance startup. The CPF merge operation works only once for each instance.

Our cluster architecture is very simple, it would consist of one Node1 (master node) and two Data Nodes (check all available roles). Unfortunately, docker-compose cannot deploy to several servers (although it can deploy to remote hosts), so this is useful for local development of sharding-aware data models,  tests, and such. For a productive InterSystems IRIS Cluster deployment, you should use either ICM or IKO.


Let's start with docker-compose configuration:


As you can see we're running a default intersystems/iris:2020. image, providing the license key (it must support sharding), persisting the data using Durable %SYS feature, and provide ISC_CPF_MERGE_FILE pointing at our merge files (which are different for Node1 and Data Nodes). Additionally Data Nodes are started a minute late allowing Node1 to start and that's an extremely conservative estimate, on a decent hardware startup time takes seconds tops.

Cluster configuration happens at CPF merge files, let's check them out




What happens here?

In the [Startup] part we enable Sharding by assigning Node1 role to our cluster. And in [config]we expand our server a bit allowing more caches and connections. That's all!




For data nodes, we need to provide the URL of the Node1 and the node role.

Try it

Check the repository or run this code:

git clone
cd iris-container-recipes
cd cluster
// copy iris.key in cluster folder
docker-compose up -d

After starting the InterSystems IRIS cluster you can access it from the browser. User/pass is: _SYSTEM/SYS.


Merge CPF files is a great and simple tool allowing you to configure InterSystems IRIS instances.

Thank you to @Luca Ravazzolo for providing the code and answering all of my questions.

Discussion (3)4
Log in or sign up to continue