Artemis Cluster Setup
Configure and Run ze-artemis 2 Node Cluster
The Artemis .jar and Artemis dependecies are installed in the ‘{{ZEPHYR_HOME}}/artemis’ folder during the installation or upgrade of Zephyr.
Follow the steps below to set up and run the ze-artemis application in a clustered environment.
-
By default, the
artemis.propertiesfile looks like below in the location {{ZEPHYR_HOME}}/artemis.#### Cluster configurations #artemis.cluster.enabled=true #artemis.cluster.nodes=node1,node2 #artemis.primary.node=node1 #artemis.node.node1.ip=localhost #artemis.node.node1.port=61616 #artemis.node.node2.ip=localhost #artemis.node.node2.port=61617 #artemis.node.node3.ip=localhost #artemis.node.node3.port=61618 #### Cluster configurations end # #server properties spring.application.name=ze-artemis spring.artemis.mode=embedded server.port=6092 # #Management endpoints spring.jmx.enabled=true management.endpoint.jmx.enabled=true management.endpoints.jmx.exposure.include=* management.endpoints.web.exposure.include=hawtio,jolokia hawtio.authenticationEnabled=false #hawtio.username=admin #hawtio.password=admin # # Artemis broker configurations artemis.queue.name=ze-artemis-queue artemis.tcp.ip=localhost artemis.tcp.port=61616 artemis.node.name=ze-artemis consumer.enabled=false # ##shared folder for all nodes, this is where the journal, bindings, paging and large-messages directories are stored artemis.journal.directory=artemis/target/data/shared/journal artemis.bindings.directory=artemis/target/data/shared/bindings artemis.paging.directory=artemis/target/data/shared/paging artemis.large-messages.directory=artemis/target/data/shared/large-messages -
Enable the properties under the Cluster Configurations accordingly as per the required cluster nodes.
-
Configure the IPs of Node 1 and Node 2 in
artemis.node.node1.ipandartemis.node.node2.ip, respectively. -
Configure the Artemis broker configurations as per the cluster nodes.
-
Create a shared folder and add the folder path in the shared folder configuration.
#artemis.propertiesof Node 1 should look like this now:#### Cluster configurations artemis.cluster.enabled=true artemis.cluster.nodes=node1,node2 artemis.primary.node=node1 artemis.node.node1.ip=192.168.0.1 artemis.node.node1.port=61616 artemis.node.node2.ip=192.168.0.2 artemis.node.node2.port=61617 #### Cluster configurations end # #server properties spring.application.name=ze-artemis-node1 spring.artemis.mode=embedded server.port=6092 # #Management endpoints spring.jmx.enabled=true management.endpoint.jmx.enabled=true management.endpoints.jmx.exposure.include=* management.endpoints.web.exposure.include=hawtio,jolokia hawtio.authenticationEnabled=false #hawtio.username=admin #hawtio.password=admin # # Artemis broker configurations artemis.queue.name=ze-artemis-queue artemis.tcp.ip=192.168.0.1 artemis.tcp.port=61616 artemis.node.name=node1 consumer.enabled=false # ##shared folder for all nodes, this is where the journal, bindings, paging and large-messages directories are stored artemis.journal.directory=/home/ubuntu/artemis-data/target/data/shared/journal artemis.bindings.directory=/home/ubuntu/artemis-data/target/data/shared/bindings artemis.paging.directory=/home/ubuntu/artemis-data/target/data/shared/paging artemis.large-messages.directory=/home/ubuntu/artemis-data/target/data/shared/large-messages-
artemis-datais the shared folder created under location /home/ubuntu/. -
target/data/shared/journal,target/data/shared/bindings,target/data/shared/paging, andtarget/data/shared/large-messageswill be created automatically once artemis is started
-
-
#artemis.propertiesof Node 2 should look like this now:#### Cluster configurations artemis.cluster.enabled=true artemis.cluster.nodes=node1,node2 artemis.primary.node=node1 artemis.node.node1.ip=192.168.0.1 artemis.node.node1.port=61616 artemis.node.node2.ip=192.168.0.2 artemis.node.node2.port=61617 #### Cluster configurations end # #server properties spring.application.name=ze-artemis-node2 spring.artemis.mode=embedded server.port=6092 # #Management endpoints spring.jmx.enabled=true management.endpoint.jmx.enabled=true management.endpoints.jmx.exposure.include=* management.endpoints.web.exposure.include=hawtio,jolokia hawtio.authenticationEnabled=false #hawtio.username=admin #hawtio.password=admin # # Artemis broker configurations artemis.queue.name=ze-artemis-queue artemis.tcp.ip=192.168.0.2 artemis.tcp.port=61617 artemis.node.name=node2 consumer.enabled=false # ##shared folder for all nodes, this is where the journal, bindings, paging and large-messages directories are stored artemis.journal.directory=/home/ubuntu/artemis-data/target/data/shared/journal artemis.bindings.directory=/home/ubuntu/artemis-data/target/data/shared/bindings artemis.paging.directory=/home/ubuntu/artemis-data/target/data/shared/paging artemis.large-messages.directory=/home/ubuntu/artemis-data/target/data/shared/large-messagesFor a 3-Node cluster, follow the same steps as for Node 2. Create one more property file and add the details of Node 3.
Create Shared Directory Using NFS (Linux)
To create a shared directory using Network File System (NFS) on Linux, perform the following steps:
Example: DB Node
-
Install NFS utilities:
sudo yum install nfs-utils -
Create a shared directory and set permission:
sudo mkdir -p /home/ubuntu/artemis-data sudo chmod 777 /home/ubuntu/artemis-data -
Configure the NFS export: edit the NFS exports file
/etc/exports(replace <Node1-IP> and <Node2-IP> with the actual IP address of Node 1 and Node 2):/home/ubuntu/artemis-data <Node1-IP>(rw,sync,no_root_squash,no_subtree_check) /home/ubuntu/artemis-data <Node2-IP>(rw,sync,no_root_squash,no_subtree_check) -
Start and enable the NFS services:
sudo systemctl enable nfs-server sudo systemctl start nfs-server -
Export the shared directory:
sudo exportfs -a
For example, on Node 1 and Node 2.
-
Install NFS utilities:
sudo yum install nfs-utils -
Create a mount point and set permission:
sudo mkdir -p /home/ubuntu/artemis-data sudo chmod 777 /home/ubuntu/artemis-data -
Mount the NFS share:
sudo mount <DB-Node-IP>:/home/ubuntu/artemis-data /home/ubuntu/artemis-data -
Make the mount persistent: add the following line to
/etc/fstab:<DB-Node-IP>:/home/ubuntu/artemis-data /home/ubuntu/artemis-data nfs defaults 0 0
Do Step 2 (1 to 4) in both nodes - Node 1 and Node 2.
-
On Node DB Node:
echo "Test from Node 1" > /home/ubuntu/artemis-data/testfile -
On Node 1 and Node 2:
cat /home/ubuntu/artemis-data/testfile
Caution
-
The property
artemis.primary.nodeis mandatory for clustering. Define the node name for the default primary node. -
The shared folder should be accessible for all the cluster nodes:
#shared folder for all nodes, this is where the journal, bindings, paging and large-messages directories are stored artemis.journal.directory=target/data/shared/journal artemis.bindings.directory=target/data/shared/bindings artemis.paging.directory=target/data/shared/paging artemis.large-messages.directory=target/data/shared/large-messages
Configure Artemis Shared Folder (Windows)
This section describes how to configure the Artemis shared folder on a Windows Workgroup environment.
Set Up Windows Workgroup Environment
Prerequisites
-
Administrator access on both the file server and the Artemis node.
-
Both machines must be reachable by name over the network.
To configure the workgroup settings, perform the following steps:
On the File Server
-
Create a new user account by running the following command:
net user artemisuser <password> /addYou can use a different name if required.
-
Create and share a folder.
To create and share a folder, do the following:
-
Create a new folder in the desired location.
-
Right-click the folder and select Properties.
-
On the Sharing tab, select Advanced Sharing.
-
Select Permissions, then grant
artemisuserFull Control. -
Select OK to apply the changes.
On the Artemis Node
-
-
Map the shared folder.
To map the shared folder, do the following:
-
Open File Explorer.
-
Select Map network drive.
-
In the Folder box, enter the network path:
\\<MACHINE_NAME>\<Shared-Folder-Name>\ -
Select the Connect using different credentials checkbox.
-
Enter the credentials for
artemisuser. -
Select Finish.
-
-
Create a local user account with the same username and password used in step 1 by running the following command:
net user artemisuser <password> /add -
Add
artemisuserto the local Administrators group. -
Configure the Artemis service.
To configure the Artemis service, do the following:
-
Open services.msc.
-
In the services list, open the Artemis service.
-
Select the Log On tab.
-
Select This account and enter
.\artemisuserwith the password. -
Select OK.
-
-
In the Artemis properties, configure the shared directory path using the following format:
\\<MACHINE_NAME>\<Shared-Folder-Name>\ -
Start the Artemis service.
Set Up Windows Domain Environment
Prerequisites
-
A domain user account with access to both the file server and the Artemis node.
-
Administrator access on both machines.
To set up a Windows domain, perform the following steps:
On the File Server
-
Create and share a folder.
To create and configure the shared folder, do the following:
-
Create a new folder in the desired location.
-
Right-click the folder and select Properties.
-
On the Sharing tab, select Advanced Sharing.
-
Select Permissions, then grant the domain user Full Control.
-
Select OK to apply the changes.
-
-
Disable caching, leasing, and encryption on the shared folder by running the following commands in PowerShell:
The example below uses
ArtemisSharedas the share name. Substitute your own share name if different.Set-SmbShare ` -Name "ArtemisShared" ` -CachingMode None ` -LeasingMode None ` -EncryptData $false ` -ForceTo verify the settings, run the following command:
Get-SmbShare -Name "ArtemisShared" | Select-Object Name, Path, CachingMode, LeasingMode, EncryptDataOn the Artemis Node
-
Map the shared folder.
To map the shared folder, do the following:
-
Open File Explorer.
-
Select Map network drive.
-
Enter the network path to the shared folder.
-
Select the Connect using different credentials checkbox.
-
Enter the domain credentials from step 1.
-
Select Finish.
-
-
To disable client-side caching on the Artemis node, run the following commands:
Set-SmbClientConfiguration ` -DirectoryCacheLifetime 0 ` -FileInfoCacheLifetime 0 ` -FileNotFoundCacheLifetime 0 ` -ForceTo verify the settings, run the following command:
Get-SmbClientConfiguration | Select-Object DirectoryCacheLifetime, FileInfoCacheLifetime, FileNotFoundCacheLifetime -
In the Windows Services manager, update Artemis Service Log On.
To update the Artemis service log on, do the following:
-
Open services.msc.
-
In the services list, open the Artemis service.
-
Select the Log On tab.
-
Enter the domain user credentials and select OK.
-
-
In the Artemis properties, configure the directory path using the Universal Naming Convention (UNC) format:
\\<MACHINE_NAME>\<Shared-Folder-Name>\ -
Start the Artemis service.