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
Note
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-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.