Initial considerations
- There has to be only one indexation service (Solr) to be shared by all instances, so it must be isolated in another environment;
- All instances should have access to the same shared folder, where the file system repository is;
- The database must be the same one for all instances;
- You need to maintain session affinity, that is, since the user logged in by accessing in an instance, they will always be directed to the same instance.
Preparing the environment
Before starting the installation, you need to prepare the environment. Do the following:
- Install the database and create an instance;
- Install the distribution standard memcached and if necessary set it up;
- Choose a folder and a server and make it accessible to all the machines that will be part of the Load Balancer.
Installing the first node
For simplification purposes, this tutorial will assume that: The Solr and Realtime servers to be used will be those installed on that node; the installation will be made in the standard folder ("c:\fluig").
- Install
the application by the normal procedure and just be careful to:
- Enter the correct database URL;
- Enter
the correct URL for the memcached server.
- Make a copy of the folder "apps" (located at \fluig\jboss) to
the one called "appslb";
xcopy apps appslb /s/e
- Make a copy of the folder "standalone" to the one called
"standalone-node1".
cp -Rp standalone standalone-node1
- Edit the file standalone-node1/configuration/standalone.xml:
In the subsystem "com.totvs.technology.wcm" add the "dir" attribute pointing to the folder "nodelb". It will look like this:
<subsystem xmlns="urn:com.totvs.technology.wcm:1.0" refresh="15" dir="/fluig/jboss/appslb"/>
Change the value of the binding property "wcm/globalDataDir" to point to the folder shared between the instances:
<simple name="java:global/wcm/globalDataDir" value="{pasta global}"/>
The property "wcm/applicationUploadDir" should point to the same "nodelb" folder:
<simple name="java:global/wcm/applicationUploadDir" value="/fluig/jboss/appslb"/>
In the sysbsystem "jboss:domain:web" add the attribute instance-id="${jboss.node.name:node0}"
In the folder “c:\fluig\jboss\bin”, create the script "node1.bat". In “ip-do-servidor” ("server IP") enter the IP address of the server where Fluig is running.
call standalone.bat -c standalone.xml -b {ip-do-servidor} -Djboss.server.base.dir=..\standalone-node1 -Djboss.node.name=node1 -Djboss.socket.binding.port-offset=100
Start the first node with the script "node1.sh":
node1.bat
After you start and are able to log in as the user "wcmadmin", drop Fluig;
Connect to the database and set the value of the field server_url from the table wcm_configuration. The saved URL contains the 8080 port, change the value to not contain the port (or change it to the apache port if it is not on 80 port);
Start Fluig again with the script "node1.bat";
Creating a second node in the same installation
Make a copy of the folder "standalone-node1" to the one called "standalone-node2".
xcopy standalone-node1 standalone-node2 /s/e
From the folder "apps", delete the file "foundation-addon-indexer-web.war", which is from the Solr server;
In the folder “c:\fluig\jboss\bin”, create the script "node2.bat". In “ip-do-servidor” ("server IP") enter the IP address of the server where Fluig is running.
call standalone.sh -c standalone.xml -b {ip-do-servidor} -Djboss.server.base.dir=..\standalone-node2 -Djboss.node.name=node2 -Djboss.socket.binding.port-offset=200
Creating a third node on another machine
- Install the application by the normal procedure and just be
careful to:
- Enter the correct database URL;
- Enter
the correct URL for the memcached server.
- Edit the file standalone\configuration\standalone.xml:
Still in "<system-properties>", change the property "totvs/solrURL" by entering the Solr URL of the first instance. Just change the IP for the server IP of the first instance.
Change the value of the binding property "wcm/globalDataDir" to point to the folder shared between the instances:
<simple name="java:global/wcm/globalDataDir" value="{pasta global}"/>
Change the value of the binding property "wcm/cacheServerAddress" to point to the memcached:
<simple name="java:global/wcm/cacheServerAddress" value="{ip servidor 1}:11211"/>
Change the binding properties "node.chat.url" and "node.realtime.url" to point to the IP of the first instance.
In the sysbsystem “jboss:domain:web” add the attribute instance-id="${jboss.node. name:node0}"
In the folder “c:\fluig\jboss\bin”, create the script "node3.bat". In “ip-do-servidor” ("server IP") enter the IP address of the server where Fluig is running.
call standalone.bat -c standalone.xml -b {ip-do-servidor} -Djboss.server.base.dir=..\standalone-node3 -Djboss.node.name=node3
From the folder "apps", delete the file "foundation-addon-indexer-web.war", which is from the Solr server;
Start the first node with the script "node3.sh":
node3.bat
Configuring Microsoft NLB
There are 3 ports to be configured:
7777 and 8888 for Fluig Realtime:
- Both should be in "Single" mode.
- For more information go to Configuring Fluig Realtime for cluster execution.
HTTP port for the Fluig Server
- This is usually either 8080 or just 80.
- This door must be in the "Multiple mode" and "Single affinity".