<commit_before>---
layout: post
title: Building a Mission-Critical Open Source Environment for the Java Platform - Chapter II
tags: [jboss, wildfly, ha, redhat, centos, modcluster]
comments: true
---

In [Chapter I](http://mlab.run/2019/12/18/wildfly-ha-1), we set up the high availability of the Web layer. In this chapter we will install WildFly and connect it to Mod Cluster.

##  Install Wildfly 18

Let's start building the application layer of our environment.These settings will be performed on the following servers:

* server-domain.mmagnani.lab - 10.0.0.68
* server-slave-0.mmagnani.lab -10.0.0.67
* server-slave-1.mmagnani.lab - 10.0.0.66

{% highlight bash %}
[root@server-domain ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-domain ~]# systemctl stop firewalld
[root@server-domain ~]# systemctl disable firewalld
[root@server-domain ~]# setenforce 0
[root@server-domain ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-domain ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-domain ~]# mkdir -p /usr/local/wildfly
[root@server-domain ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-domain ~]# cd /usr/local/wildfly
[root@server-domain ~]# unzip wildfly-18.0.1.Final.zip
[root@server-domain ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-domain ~]# usermod -aG wildfly wildfly
[root@server-domain ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-domain ~]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-domain ~]# systemctl enable wildfly
[root@server-domain ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-domain ~]# jps -m
1571 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules 
#suppress
{% endhighlight %}

It's a bit boring but let's repeat the same process for the other two servers.

{% highlight bash %}
[root@server-slave-0 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-slave-0 ~]# systemctl stop firewalld
[root@server-slave-0 ~]# systemctl disable firewalld
[root@server-slave-0 ~]# setenforce 0
[root@server-slave-0 ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-slave-0 ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-slave-0 ~]# mkdir -p /usr/local/wildfly
[root@server-slave-0 ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-slave-0 ~]# cd /usr/local/wildfly
[root@server-slave-0 ~]# unzip wildfly-18.0.1.Final.zip
[root@server-slave-0 ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-slave-0 ~]# usermod -aG wildfly wildfly
[root@server-slave-0 ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-slave-0 ~]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-slave-0~]# systemctl enable wildfly
[root@server-slave-0 ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-slave-0 ~]# jps -m
1968 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules org.jboss.as.server
#suppress
{% endhighlight %}

And now on the last server:

{% highlight bash %}
[root@server-slave-1 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-slave-1 ~]# systemctl stop firewalld
[root@server-slave-1 ~]# systemctl disable firewalld
[root@server-slave-1 ~]# setenforce 0
[root@server-slave-1 ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-slave-1 ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-slave-1 ~]# mkdir -p /usr/local/wildfly
[root@server-slave-1 ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-slave-1 ~]# cd /usr/local/wildfly
[root@server-slave-1 ~]# unzip wildfly-18.0.1.Final.zip
[root@server-slave-1 ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-slave-1 ~]# usermod -aG wildfly wildfly
[root@server-slave-1 ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-domain wildfly]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-slave-1 ~]# systemctl enable wildfly
[root@server-slave-1 ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-slave-0 ~]# jps -m
1948 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules org.jboss.as.server
#suppress
{% endhighlight %}

It is! Now we have Wildfly running in Domain mode on all three servers.

## Configuring the Master/Slave Architecture



#WIP
Best,<commit_msg>add new wildfly post<commit_after>---
layout: post
title: Building a Mission-Critical Open Source Environment for the Java Platform - Chapter II
tags: [jboss, wildfly, ha, redhat, centos, modcluster]
comments: true
---

In [Chapter I](http://mlab.run/2019/12/18/wildfly-ha-1), we set up the high availability of the Web layer. In this chapter we will install WildFly and connect it to Mod Cluster.

##  Install Wildfly 18

Let's start building the application layer of our environment.These settings will be performed on the following servers:

* server-domain.mmagnani.lab - 10.0.0.68
* server-slave-0.mmagnani.lab -10.0.0.67
* server-slave-1.mmagnani.lab - 10.0.0.66


Let's start with the server that will be the "Master":

{% highlight bash %}
[root@server-domain ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-domain ~]# systemctl stop firewalld
[root@server-domain ~]# systemctl disable firewalld
[root@server-domain ~]# setenforce 0
[root@server-domain ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-domain ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-domain ~]# mkdir -p /usr/local/wildfly
[root@server-domain ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-domain ~]# cd /usr/local/wildfly
[root@server-domain ~]# unzip wildfly-18.0.1.Final.zip
[root@server-domain ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-domain ~]# usermod -aG wildfly wildfly
[root@server-domain ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-domain ~]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-domain ~]# systemctl enable wildfly
[root@server-domain ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-domain ~]# jps -m
1571 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules 
#suppress
{% endhighlight %}

Now let's set up "Slave 0":

{% highlight bash %}
[root@server-slave-0 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-slave-0 ~]# systemctl stop firewalld
[root@server-slave-0 ~]# systemctl disable firewalld
[root@server-slave-0 ~]# setenforce 0
[root@server-slave-0 ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-slave-0 ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-slave-0 ~]# mkdir -p /usr/local/wildfly
[root@server-slave-0 ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-slave-0 ~]# cd /usr/local/wildfly
[root@server-slave-0 ~]# unzip wildfly-18.0.1.Final.zip
[root@server-slave-0 ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-slave-0 ~]# usermod -aG wildfly wildfly
[root@server-slave-0 ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-slave-0 ~]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-slave-0~]# systemctl enable wildfly
[root@server-slave-0 ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-slave-0 ~]# jps -m
1968 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules org.jboss.as.server
#suppress
{% endhighlight %}

And now let's set up "Slave 1":

{% highlight bash %}
[root@server-slave-1 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@server-slave-1 ~]# systemctl stop firewalld
[root@server-slave-1 ~]# systemctl disable firewalld
[root@server-slave-1 ~]# setenforce 0
[root@server-slave-1 ~]# sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@server-slave-1 ~]# yum install java-1.8.0-openjdk-devel.x86_64 vim wget unzip telnet -y
[root@server-slave-1 ~]# mkdir -p /usr/local/wildfly
[root@server-slave-1 ~]# wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip -P /usr/local/wildfly
[root@server-slave-1 ~]# cd /usr/local/wildfly
[root@server-slave-1 ~]# unzip wildfly-18.0.1.Final.zip
[root@server-slave-1 ~]# useradd -p `openssl passwd -1 wildfly` wildfly
[root@server-slave-1 ~]# usermod -aG wildfly wildfly
[root@server-slave-1 ~]# chown -R wildfly:wildfly /usr/local/wildfly/wildfly-18.0.1.Final
[root@server-domain wildfly]# vi /etc/systemd/system/wildfly.service

Description=WildFly 18.0.1
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/local/wildfly/wildfly-18.0.1.Final/bin/domain.sh

[Install]
WantedBy=multi-user.target

[root@server-slave-1 ~]# systemctl enable wildfly
[root@server-slave-1 ~]# reboot
{% endhighlight %}

Check that the WildFly process has gone up correctly:

{% highlight bash %}
[root@server-slave-0 ~]# jps -m
1948 jboss-modules.jar -mp /usr/local/wildfly/wildfly-18.0.1.Final/modules org.jboss.as.server
#suppress
{% endhighlight %}

It is! Now we have Wildfly running in Domain mode on all three servers.

## Configuring the Master/Slave Architecture



#WIP
Best,
{'fraction_non_alphanumeric': 0.15323840146991272, 'fraction_numerical': 0.03785025264124942, 'mean_word_length': 4.495204442200909, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866603', 'n_tokens_mistral': 4476, 'n_tokens_neox': 4105, 'n_words': 888}