5.2. Installing in Domain Mode The Domain mode is for multiple server instances. It requires load balancing capable for handling TCP for JDBC connections. (Apache will not work in this case.) When you have more than one Red Hat JBoss EAP instance in your server farm and you start them all in domain mode, all of the configuration options for this server farm can be centrally managed. For example, you can deploy an artifact or create a data source across all the instances, with one single CLI-based call. Red Hat JBoss Data Virtualization extends this configuration concept to allow you to deploy your VDBs and translators across the whole server farm. When domain mode is combined with the HA (high availability) profile, you can cluster the Red Hat JBoss Data Virtualization server instances that are deployed. (The HA profile is set as the default in the domain.xml file.) When you start the server using the domain.xml file, the distributed caching that is used for ResultSet caching and Internal Materialized caching is automatically configured. You use the Admin API the same way in both the standalone mode and the domain mode. When multiple Red Hat JBoss Data Virtualization instances are available in a cluster, you can make use load balancing and fail-over features. You must create a server group, then create a server and then deploy all the available resources to the server group you have created. The following instructions teach you how to install a systemd service on Linux. For other use cases, please refer to https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html-single/administration_and_configuration_guide/index . To start the server in "Domain" mode, install Red Hat JBoss Data Virtualization on all the servers that are going to be part of the cluster. Select one of the servers as the "master" domain controller. (The rest of the servers will be slaves that connect to the "master" domain controller for all the administrative operations.) On the domain controller, copy the domain-controller/init.d directory to JBOSS_HOME/bin . On the host controller, copy the host-controller/init.d directory to JBOSS_HOME/bin . Prepare the directory structure: Configure the domain: Configure the host controller: Add this Red Hat JBoss Data Virtualization script to systemd: Configure the firewall ports on both hosts: If you are using port offsets, adjust the values by adding the offset. Once you have configured all the servers, start the "master" node: Start the "slave" nodes: The slave nodes fetch their domain configuration settings from the "master" node. Once VDBs have been deployed, users can connect their JDBC applications to Red Hat JBoss Data Virtualization. You can enable Red Hat JBoss Data Virtualization as a service with the operating system, using this command: You can now start the service like this: To stop it, run this command: To restart, run this command: Note Teiid Designer cannot connect to the Red Hat JBoss Data Virtualization Server in "domain" mode. Red Hat recommends using other types of deployment strategies (such as CLI or web-console) for deploying and testing, as it is expected you will be using domain mode in production environments. Teiid Designer is to aid development-time activities only and should only be used in testing environments.

Commands:
adduser jboss mkdir /opt/jdv mkdir /etc/jboss-as mkdir /var/log/jboss mkdir /var/run/jboss chown -R jboss: /opt/jdv chown -R jboss: /etc/jboss-as chown -R jboss: /var/log/jboss chown -R jboss: /var/run/jboss
cat > /etc/jboss-as/jboss-as.conf <<EOF JBOSS_HOME=/opt/jdv/jboss-data-virtualization JBOSS_PIDFILE=/var/run/jboss/jboss-as-domain.pid JBOSS_HOST_CONFIG=host.xml JBOSS_ADDRESS_MANAGEMENT=10.255.0.82 JBOSS_USER=jboss JBOSS_CONSOLE_LOG=/var/log/jboss/console.log EOF
cat > /etc/jboss-as/jboss-as.conf <<EOF JBOSS_HOME=/opt/jdv/jboss-data-virtualization JBOSS_PIDFILE=/var/run/jboss/jboss-as-domain.pid JBOSS_HOST_CONFIG=host-slave.xml JBOSS_MASTER_ADDRESS=10.255.0.82 JBOSS_PUBLIC_ADDRESS=10.255.0.83 JBOSS_USER=jboss JBOSS_CONSOLE_LOG=/var/log/jboss/console.log EOF
JBOSS_HOME=/opt/jdv/jboss-data-virtualization cat > /tmp/teste <<EOF [Unit] Description=JBoss Data Virtualization Systemctl script After=NetworkManager.service [Service] Type=forking ExecStart=USDJBOSS_HOME/bin/init.d/jboss-as-domain.sh start ExecStop=USDJBOSS_HOME/bin/init.d/jboss-as-domain.sh stop ExecReload=USDJBOSS_HOME/bin/init.d/jboss-as-domain.sh restart PIDFile=/var/run/jboss/jboss-as-domain.pid [Install] WantedBy=multi-user.target EOF
cat > /etc/firewalld/services/jboss-data-virtualization.xml <?xml version="1.0" encoding="utf-8"?> <service version="1.0"> <short>jboss-data-virtualization</short> <port port="31000" protocol="tcp"/> <port port="8080" protocol="tcp"/> <port port="8443" protocol="udp"/> <port port="8009" protocol="tcp"/> <port port="4447" protocol="tcp"/> <port port="9990" protocol="udp"/> <port port="9999" protocol="tcp"/> </service> EOF
firewall-cmd --zone=public --add-service=jboss-data-virtualization firewall-cmd --permanent --zone=public --add-service=jboss-data-virtualization firewall-cmd --zone=public --list-services firewall-cmd --permanent --zone=public --list-services
/bin/domain.sh
/bin/domain.sh
systemctl enable jboss-data-virtualization
systemctl start jdv
systemctl stop jdv
systemctl restart jdv