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.

  1. By default, the artemis.properties file 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
  2. Enable the properties under the Cluster Configurations accordingly as per the required cluster nodes.

  3. Configure the IPs of Node 1 and Node 2 in artemis.node.node1.ip and artemis.node.node2.ip, respectively.

  4. Configure the Artemis broker configurations as per the cluster nodes.

  5. Create a shared folder and add the folder path in the shared folder configuration. #artemis.properties of 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

    Note

    • artemis-data is the shared folder created under location /home/ubuntu/.

    • target/data/shared/journal, target/data/shared/bindings, target/data/shared/paging, and target/data/shared/large-messages will be created automatically once artemis is started

  6. #artemis.properties of 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-messages

    Note

    For 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:

Note

Do Step 2 (1 to 4) in both nodes - Node 1 and Node 2.

Caution

  • The property artemis.primary.node is 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

Note

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

  1. Create a new user account by running the following command:

    net user artemisuser <password> /add

    You can use a different name if required.

  2. Create and share a folder.

    To create and share a folder, do the following:

    1. Create a new folder in the desired location.

    2. Right-click the folder and select Properties.

    3. On the Sharing tab, select Advanced Sharing.

    4. Select Permissions, then grant artemisuser Full Control.

    5. Select OK to apply the changes.

    On the Artemis Node

  3. Map the shared folder.

    To map the shared folder, do the following:

    1. Open File Explorer.

    2. Select Map network drive.

    3. In the Folder box, enter the network path:

      \\<MACHINE_NAME>\<Shared-Folder-Name>\

    4. Select the Connect using different credentials checkbox.

    5. Enter the credentials for artemisuser.

    6. Select Finish.

  4. 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
  5. Add artemisuser to the local Administrators group.

  6. Configure the Artemis service.

    To configure the Artemis service, do the following:

    1. Open services.msc.

    2. In the services list, open the Artemis service.

    3. Select the Log On tab.

    4. Select This account and enter .\artemisuser with the password.

    5. Select OK.

  7. In the Artemis properties, configure the shared directory path using the following format:

    \\<MACHINE_NAME>\<Shared-Folder-Name>\
  8. Start the Artemis service.

Set Up Windows Domain Environment

Note

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

  1. Create and share a folder.

    To create and configure the shared folder, do the following:

    1. Create a new folder in the desired location.

    2. Right-click the folder and select Properties.

    3. On the Sharing tab, select Advanced Sharing.

    4. Select Permissions, then grant the domain user Full Control.

    5. Select OK to apply the changes.

  2. Disable caching, leasing, and encryption on the shared folder by running the following commands in PowerShell:

    Note

    The example below uses ArtemisShared as the share name. Substitute your own share name if different.

    Set-SmbShare `
        -Name "ArtemisShared" `
        -CachingMode None `
        -LeasingMode None `
        -EncryptData $false `
        -Force

    To verify the settings, run the following command:

    Get-SmbShare -Name "ArtemisShared" | Select-Object Name, Path, CachingMode, LeasingMode, EncryptData

    On the Artemis Node

  3. Map the shared folder.

    To map the shared folder, do the following:

    1. Open File Explorer.

    2. Select Map network drive.

    3. Enter the network path to the shared folder.

    4. Select the Connect using different credentials checkbox.

    5. Enter the domain credentials from step 1.

    6. Select Finish.

  4. To disable client-side caching on the Artemis node, run the following commands:

    Set-SmbClientConfiguration `
        -DirectoryCacheLifetime 0 `
        -FileInfoCacheLifetime 0 `
        -FileNotFoundCacheLifetime 0 `
        -Force

    To verify the settings, run the following command:

    Get-SmbClientConfiguration | Select-Object DirectoryCacheLifetime, FileInfoCacheLifetime, FileNotFoundCacheLifetime
  5. In the Windows Services manager, update Artemis Service Log On.

    To update the Artemis service log on, do the following:

    1. Open services.msc.

    2. In the services list, open the Artemis service.

    3. Select the Log On tab.

    4. Enter the domain user credentials and select OK.

  6. In the Artemis properties, configure the directory path using the Universal Naming Convention (UNC) format:

    \\<MACHINE_NAME>\<Shared-Folder-Name>\
  7. Start the Artemis service.

Publication date: