Contents

  1. Introduction
  2. Setting up the nodes
  3. Accessing the cluster from PHP

Introduction

evQueue supports high availability clustering. In a clustered environment, all nodes are active and share the same configuration. Node use notifications to reload when configuration changes are made.

To achieve a truly high available cluster, you will also need a clustered database like MariaDB with galera cluster.

Setting up the nodes

First, you will need to install at least 2 standalone nodes. See installation, from source or from package. evQueue can support any number of nodes. You can have a look at the cluster sample configuration files.

Let's say that you have 2 nodes, named node1 and node2. Node1's IP address is 10.0.0.1 and node2's is 10.0.0.2.

On node1

Edit the configuration file and set the node name properly:

cluster.node.name = node1

Also set the cluster description:

cluster.nodes = tcp://10.0.0.1:5000,tcp://10.0.0.2:5000

For notifications to work, you'll need to specify a valid user with admin rights:

cluster.notify.user = notifyuser
cluster.notify.password = notifypassword

Configure nodes to listen on external IP:

network.bind.ip=*
ws.bind.ip=*

On node2

Replicate the configuration, just change the node name:

cluster.node.name = node2
cluster.nodes = tcp://10.0.0.1:5000,tcp://10.0.0.2:5000
cluster.notify.user = notifyuser
cluster.notify.password = notifypassword
network.bind.ip=*
ws.bind.ip=*

On both nodes

Restart evQueue engine:

user@evqueue:~# systemctl restart evqueue

On the web board

Edit the configuration file located in conf/cluster.json under the document root. Set the cluster descriptor:

			{
				"local#bbbbbb": [
					"ws://10.0.0.1:5001",
					"ws://10.0.0.2:5001"
				]
			}
		

That's it, you have your cluster configured!

Accessing the cluster from PHP

We provide a PHP class to seamlessly access an evQueue cluster. Please have a look at the evQueueCluster PHP class in the sample project.