Skip to content

Commit

Permalink
Commit from GitHub Actions (WildFly Quickstarts Update 'README.adoc's)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmartins committed May 27, 2024
1 parent e7feb5c commit a0c27ec
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 67 deletions.
74 changes: 26 additions & 48 deletions ha-singleton-deployment/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ endif::[]
The `ha-singleton-deployment` quickstart demonstrates the recommended way to deploy any service packaged in an application archive as a cluster-wide singleton.

:standalone-server-type: ha
:archiveType: jar
:archiveType: war
:requires-multiple-servers:
:jbds-not-supported:

== What is it?

The `ha-singleton-deployment` quickstart demonstrates the deployment of a service packaged in an application as a cluster-wide singleton using singleton deployments.
In this example, the service is a timer that is initialized by a `@Startup @Singleton` bean.
The example is built and packaged as a single EJB archive.
In this example, the service is a timer that is initialized by a `@Startup @Singleton` Jakarta Enterprise Beans bean.
The example is built and packaged as a single web archive.

For more information about singleton deployments, see _HA Singleton Deployments_ in the {LinkDevelopmentGuide}[__{DevelopmentBookName}__] for {DocInfoProductName} located on the Red Hat Customer Portal.

Expand Down Expand Up @@ -312,15 +312,15 @@ This example is not limited to two servers. Additional servers can be started by
$ mvn clean install wildfly:deploy
----
. Ensure the `target/{artifactId}.jar` archive is deployed to `node1` (the one without port offset) by observing the log.
. Ensure the `target/{artifactId}.war` archive is deployed to `node1` (the one without port offset) by observing the log.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "ha-singleton-deployment.jar" (runtime-name: "ha-singleton-deployment.jar")
INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "ha-singleton-deployment.war" (runtime-name: "ha-singleton-deployment.war")
...
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node1 elected as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.jar".FIRST_MODULE_USE service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.jar".FIRST_MODULE_USE service
INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "ha-singleton-deployment.jar" (runtime-name : "ha-singleton-deployment.jar")
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node1 elected as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.war".FIRST_MODULE_USE service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.war".FIRST_MODULE_USE service
INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "ha-singleton-deployment.war" (runtime-name : "ha-singleton-deployment.war")
...
WARNING [class org.jboss.as.quickstarts.ha.singleton.SingletonTimer] (ServerService Thread Pool -- 68) SingletonTimer is initializing.
INFO [class org.jboss.as.quickstarts.ha.singleton.SingletonTimer] (EJB default - 1) SingletonTimer: Hello World!
Expand All @@ -341,19 +341,19 @@ WARN [org.jboss.as.clustering.jgroups.protocol.UDP] (ServerService Thread Pool
mvn wildfly:deploy -Dwildfly.port=10090
----
. Ensure the `service/target/{artifactId}.jar` archive is deployed to `node2` by observing the log. Note that even though the logs indicate "Deployed", the deployment does not actually deploy completely and the timer is not operating on this node.
. Ensure the `service/target/{artifactId}.war` archive is deployed to `node2` by observing the log. Note that even though the logs indicate "Deployed", the deployment does not actually deploy completely and the timer is not operating on this node.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "ha-singleton-deployment.jar" (runtime-name: "ha-singleton-deployment.jar")
INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "ha-singleton-deployment.war" (runtime-name: "ha-singleton-deployment.war")
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000078: Starting JGroups channel server
...
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000094: Received new cluster view for channel server: [node1|1] (2) [node1, node2]
...
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000079: Channel server local address is node2, physical addresses are [127.0.0.1:55300]
INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-6) ISPN000128: Infinispan version: Infinispan 'Chakra' 8.2.7.Final
INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 68) WFLYCLINF0002: Started default cache from server container
INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "ha-singleton-deployment.jar" (runtime-name : "ha-singleton-deployment.jar")
INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "ha-singleton-deployment.war" (runtime-name : "ha-singleton-deployment.war")
----
. Verify the timer is running only on one instance by observing the logs. The node running the timer will output the following every 5 seconds:
Expand All @@ -367,7 +367,7 @@ While the instance not running, the timer will display the following as the last
+
[source,options="nowrap"]
----
INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "ha-singleton-deployment.jar" (runtime-name : "ha-singleton-deployment.jar")
INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "ha-singleton-deployment.war" (runtime-name : "ha-singleton-deployment.war")
----
. Verify failover of the singleton deployment. Shutdown the server operating as the primary provider of the singleton, for instance by using the `Ctrl` + `C` key combination in the terminal. Observe the following messages on the node being shutdown:
Expand All @@ -386,8 +386,8 @@ Now observe the log messages on the second server. The node will now be elected
+
[source,options="nowrap"]
----
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node2 elected as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.jar".FIRST_MODULE_USE service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.jar".FIRST_MODULE_USE service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node2 elected as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.war".FIRST_MODULE_USE service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the jboss.deployment.unit."ha-singleton-deployment.war".FIRST_MODULE_USE service
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (thread-4) ISPN000094: Received new cluster view for channel server: [node2|2] (1) [node2]
...
WARNING [class org.jboss.as.quickstarts.ha.singleton.SingletonTimer] (ServerService Thread Pool -- 68) SingletonTimer is initializing.
Expand All @@ -405,7 +405,7 @@ Note the `include-runtime` flag on the `read-resource` operation.
[source,options="nowrap"]
----
[standalone@localhost:9990 /] /subsystem=singleton/singleton-policy=default/deployment=ha-singleton-deployment.jar:read-resource(include-runtime=true)
[standalone@localhost:9990 /] /subsystem=singleton/singleton-policy=default/deployment=ha-singleton-deployment.war:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
Expand All @@ -423,7 +423,7 @@ The typical use case for scripting to determine the primary provider of a servic
[source,options="nowrap"]
----
[rhusar@ribera bin]$ ./jboss-cli.sh --output-json --connect "/subsystem=singleton/singleton-policy=default/deployment=ha-singleton-deployment.jar:read-attribute(name=primary-provider)"
[rhusar@ribera bin]$ ./jboss-cli.sh --output-json --connect "/subsystem=singleton/singleton-policy=default/deployment=ha-singleton-deployment.war:read-attribute(name=primary-provider)"
{
"outcome" : "success",
"result" : "node1"
Expand Down Expand Up @@ -467,9 +467,9 @@ $ mvn wildfly:deploy -Dwildfly.port=10090
[source,subs="+quotes,attributes+",options="nowrap"]
----
$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect
deployment-overlay add --name=singleton-deployment --deployments=ha-singleton-deployment.jar --content=META-INF/singleton-deployment.xml=singleton-deployment.xml
deployment-overlay add --name=singleton-deployment --deployments=ha-singleton-deployment.war --content=META-INF/singleton-deployment.xml=singleton-deployment.xml
deployment-overlay redeploy-affected --name=singleton-deployment
$ __{jbossHomeName}_2__/bin/jboss-cli.sh --connect --controller=localhost:10090 deployment-overlay add --name=singleton-deployment --deployments=ha-singleton-deployment.jar --content=META-INF/singleton-deployment.xml=singleton-deployment.xml deployment-overlay redeploy-affected --name=singleton-deployment
$ __{jbossHomeName}_2__/bin/jboss-cli.sh --connect --controller=localhost:10090 deployment-overlay add --name=singleton-deployment --deployments=ha-singleton-deployment.war --content=META-INF/singleton-deployment.xml=singleton-deployment.xml deployment-overlay redeploy-affected --name=singleton-deployment
----
+
NOTE: For Windows, use the ` __{jbossHomeName}_1__\bin\jboss-cli.bat` and ` __{jbossHomeName}_2__\bin\jboss-cli.bat` scripts.
Expand All @@ -481,7 +481,7 @@ NOTE: For Windows, use the ` __{jbossHomeName}_1__\bin\jboss-cli.bat` and ` __{j
<deployment-overlays>
<deployment-overlay name="singleton-deployment">
<content path="META-INF/singleton-deployment.xml" content="60a35e2bb6a1886f0a4abe499c7af16833d2a533"/>
<deployment name="ha-singleton-deployment.jar"/>
<deployment name="ha-singleton-deployment.war"/>
</deployment-overlay>
</deployment-overlays>
----
Expand Down Expand Up @@ -510,28 +510,6 @@ $ mvn wildfly:undeploy
$ mvn wildfly:undeploy -Dwildfly.port=10090
----
// Run the Quickstart in Red Hat CodeReady Studio or Eclipse
:leveloffset: +1
[[run_the_quickstart_in_redhat_codeready_studio_or_eclipse]]
= Run the Quickstart in {JBDSProductName} or Eclipse
//******************************************************************************
// Include this template to provide instructions to run the quickstart
// in Red Hat CodeReady Studio.
//
// If the quickstart is not supported, create the `jbds-not-supported` attribute.
//******************************************************************************
ifdef::jbds-not-supported[]
This quickstart is not supported in {JBDSProductName}.
endif::jbds-not-supported[]
ifndef::jbds-not-supported[]
You can also start the server and deploy the quickstarts or run the Arquillian tests in {JBDSProductName} or from Eclipse using JBoss tools. For general information about how to import a quickstart, add a {productName} server, and build and deploy a quickstart, see link:{useEclipseUrl}[Use {JBDSProductName} or Eclipse to Run the Quickstarts].
endif::jbds-not-supported[]
// Add additional instructions specific to running this quickstart in an IDE here.
:leveloffset!:
// Debug the Application
:leveloffset: +1
Expand Down Expand Up @@ -561,12 +539,12 @@ $ mvn dependency:resolve -Dclassifier=javadoc
:leveloffset!:
//*************************************************
// Product Release content only
//*************************************************
ifdef::ProductRelease[]
// Quickstart not compatible with OpenShift
include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1]
:leveloffset: +1
endif::[]
[[openshift_incompatibility]]
= {xpaasproduct-shortname} Incompatibility
This quickstart is not compatible with {xpaasproduct-shortname}.
:leveloffset!:
38 changes: 19 additions & 19 deletions ha-singleton-service/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ endif::[]
The `ha-singleton-service` quickstart demonstrates how to deploy a cluster-wide singleton JBoss MSC service.

:standalone-server-type: ha
:archiveType: jar
:archiveType: war
:requires-multiple-servers:
:jbds-not-supported:

Expand All @@ -218,7 +218,7 @@ The `ha-singleton-services` quickstart demonstrates pattern, or way, to deploy a

Make sure you inspect the `activate()` method of the `SingletonServiceActivator` class of the example. Although the default election policy is used to build the singleton services for this example, scripts and instructions are provided later in this document to demonstrate how to xref:configuring_election_policies[configure other election policies].

This example is built and packaged as JAR archive.
This example is built and packaged as a WAR archive.

For more information about clustered singleton services, see _HA Singleton Service_ in the {LinkDevelopmentGuide}[__{DevelopmentBookName}__] for {DocInfoProductName} located on the Red Hat Customer Portal.

Expand Down Expand Up @@ -313,18 +313,18 @@ This example demonstrates a singleton service and a querying service that regula
. Start the {productName} servers as described in the above section.
. Open a terminal and navigate to the `ha-singleton-service/` directory located in the root directory of the quickstarts.
. Use the following command to clean up any previously built artifacts, and to build and deploy the JAR archive.
. Use the following command to clean up any previously built artifacts, and to build and deploy the WAR archive.
+
[source,options="nowrap"]
----
$ mvn clean install wildfly:deploy
----
. Investigate the Console Output for Server 1. Verify that the `target/ha-singleton-service.jar` archive is deployed to `node1`, which is the first server started without port offset, by checking the server log.
. Investigate the Console Output for Server 1. Verify that the `target/ha-singleton-service.war` archive is deployed to `node1`, which is the first server started without port offset, by checking the server log.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "ha-singleton-service.jar" (runtime-name: "ha-singleton-service.jar")
INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "ha-singleton-service.war" (runtime-name: "ha-singleton-service.war")
INFO [ServiceActivator] (MSC service thread 1-5) Singleton and querying services activated.
INFO [QueryingService] (MSC service thread 1-3) Querying service started.
...
Expand All @@ -351,16 +351,16 @@ WARN [org.jboss.as.clustering.jgroups.protocol.UDP] (ServerService Thread Pool
mvn wildfly:deploy -Dwildfly.port=10090
----
. Investigate the console output for both servers. Verify that the `target/ha-singleton-service.jar` archive is deployed to `node2` by checking the server log.
. Investigate the console output for both servers. Verify that the `target/ha-singleton-service.war` archive is deployed to `node2` by checking the server log.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.repository] (management-handler-thread - 4) WFLYDR0001: Content added at location /Users/rhusar/wildfly/build/target/y/standalone/data/content/18/6efcc6c07b471f641cfcc97f9120505726e6bd/content
INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "ha-singleton-service.jar" (runtime-name: "ha-singleton-service.jar")
INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "ha-singleton-service.war" (runtime-name: "ha-singleton-service.war")
INFO [ServiceActivator] (MSC service thread 1-6) Singleton and querying services activated.
INFO [QueryingService] (MSC service thread 1-5) Querying service started.
...
INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "ha-singleton-service.jar" (runtime-name : "ha-singleton-service.jar")
INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "ha-singleton-service.war" (runtime-name : "ha-singleton-service.war")
...
INFO [org.jboss.as.quickstarts.ha.singleton.service.QueryingService] (pool-12-thread-1) Singleton service running on node1.
----
Expand Down Expand Up @@ -407,14 +407,14 @@ INFO [org.jboss.as.quickstarts.ha.singleton.service.SingletonService] (MSC serv
. Start the {productName} servers as described in the above section.
. Open a terminal and navigate to the `ha-singleton-service/` directory located in the root directory of the quickstarts.
. Use the following command to undeploy the JAR archive from Server 1.
. Use the following command to undeploy the WAR archive from Server 1.
+
[source,options="nowrap"]
----
$ mvn wildfly:undeploy
----
. Use the following command to undeploy the JAR archive from Server 2.
. Use the following command to undeploy the WAR archive from Server 2.
+
[source,options="nowrap"]
----
Expand Down Expand Up @@ -699,11 +699,11 @@ INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service
== Undeploy the Deployments
If you have not yet done so, you can undeploy all of the deployed artifacts by following these steps.
If you have not yet done so, you can undeploy all the deployed artifacts by following these steps.
. Start the two servers with the HA profile as described above.
. Open a terminal and navigate to the root directory of this quickstart.
. Use the following commands to undeploy all of the artifacts.
. Use the following commands to undeploy all the artifacts.
+
[source,options="nowrap"]
----
Expand Down Expand Up @@ -779,12 +779,12 @@ $ mvn dependency:resolve -Dclassifier=javadoc
:leveloffset!:
//*************************************************
// Product Release content only
//*************************************************
ifdef::ProductRelease[]
// Quickstart not compatible with OpenShift
include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1]
:leveloffset: +1
endif::[]
[[openshift_incompatibility]]
= {xpaasproduct-shortname} Incompatibility
This quickstart is not compatible with {xpaasproduct-shortname}.
:leveloffset!:

0 comments on commit a0c27ec

Please sign in to comment.