<div id="main-content" class="wiki-content group">
<h1 id="FluigemLoadBalancecomMicrosoftNLB-Consideraçõesiniciais">Initial
considerations</h1>
<ul>
<li>There has to be only one indexation service (Solr) to be
shared by all instances, so it must be isolated in another
environment;</li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">All
instances should have access to the same shared folder, where the
file system repository is;</span></li>
<li>The database must be the same one for all instances;</li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">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.</span></li>
</ul>
<h1 id="FluigemLoadBalancecomMicrosoftNLB-Preparandoambiente">Preparing
the environment</h1>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Before
starting the installation, you need to prepare the environment. Do
the following:</span>
</p>
<ol>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Install
the database and create an instance;</span></li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Install
the distribution standard memcached and if necessary set it up;</span></li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Choose
a folder and a server and make it accessible to all the machines
that will be part of the Load Balancer.</span></li>
</ol>
<h1 id="FluigemLoadBalancecomMicrosoftNLB-Instalandoprimeironó">Installing
the first node</h1>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">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").</span>
</p>
<ol>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;"> </span>Install
the application by the normal procedure and just be careful to:<br />
<ol>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Enter
the correct database URL;</span></li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Enter
the correct URL for the memcached server.</span><br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span></li>
</ol></li>
<li>Make a copy of the folder "apps" (located at \fluig\jboss) to
the one called "appslb";<br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;">   
xcopy apps appslb /s/e</span><br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</li>
<li>Make a copy of the folder "standalone" to the one called
"standalone-node1".<br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;"> 
 cp -Rp standalone standalone-node1</span><br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</li>
<li>Edit the file standalone-node1/configuration/standalone.xml:<br />
<ol>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">In
the subsystem "com.totvs.technology.wcm" add the "dir" attribute
pointing to the folder "nodelb". It will look like this:</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;"><subsystem xmlns="urn:com.totvs.technology.wcm:1.0" refresh="15" dir="/fluig/jboss/appslb"/></pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">  </span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Change
the value of the binding property "wcm/globalDataDir" to point to
the folder shared between the instances:</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;"><simple name="java:global/wcm/globalDataDir" value="{pasta global}"/></pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">The
property "wcm/applicationUploadDir" should point to the same
"nodelb" folder:</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;"><simple name="java:global/wcm/applicationUploadDir" value="/fluig/jboss/appslb"/></pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">In
the sysbsystem "</span><a
style="font-size: 10.0pt; line-height: 13.0pt;" rel="nofollow">jboss:domain:web"
</a><span style="font-size: 10.0pt; line-height: 13.0pt;"> add
the attribute <em> instance-id="${jboss.node.name:node0}"</em>
</span>
</p>
<p> </p></li>
</ol>
</li>
<li><p>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.</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">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</pre>
</div>
</div></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Start
the first node with the script "node1.sh":</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">node1.bat</pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"> 
 </span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">After
you start and are able to log in as the user "wcmadmin", drop
Fluig;</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">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);</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Start
Fluig again with the script "node1.bat";</span>
</p></li>
</ol>
<h1
id="FluigemLoadBalancecomMicrosoftNLB-Criandoumsegundonónamesmainstalação">Creating
a second node in the same installation</h1>
<p> </p>
<ol>
<li><p>Make a copy of the folder "standalone-node1" to the
one called "standalone-node2".</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">xcopy standalone-node1 standalone-node2 /s/e</pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"> </span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"> From
the folder "apps", delete the file
"foundation-addon-indexer-web.war", which is from the Solr server;</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">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.</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">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</pre>
</div>
</div></li>
</ol>
<h1
id="FluigemLoadBalancecomMicrosoftNLB-Criandoumterceironóemoutramáquina">Creating
a third node on another machine</h1>
<ol>
<li>Install the application by the normal procedure and just be
careful to:<br />
<ol>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Enter
the correct database URL;</span></li>
<li><span style="font-size: 10.0pt; line-height: 13.0pt;">Enter
the correct URL for the memcached server.</span><br /> <span
style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span></li>
</ol>
</li>
<li>Edit the file standalone\configuration\standalone.xml:<br />
<ol>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">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.</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Change
the value of the binding property "wcm/globalDataDir" to point to
the folder shared between the instances:</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;"><simple name="java:global/wcm/globalDataDir" value="{pasta global}"/></pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Change
the value of the binding property "wcm/cacheServerAddress" to
point to the memcached:</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;"><simple name="java:global/wcm/cacheServerAddress" value="{ip servidor 1}:11211"/></pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Change
the binding properties "node.chat.url" and "node.realtime.url" to
point to the IP of the first instance.</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">In
the sysbsystem “</span><a
style="font-size: 10.0pt; line-height: 13.0pt;" rel="nofollow">jboss:domain:web”</a><span
style="font-size: 10.0pt; line-height: 13.0pt;"> add the
attribute<em> instance-id="${jboss.node.</em>
</span><em><a href="http://namenode0"
style="font-size: 10.0pt; line-height: 13.0pt;"
class="external-link" rel="nofollow">name:node0</a><span
style="font-size: 10.0pt; line-height: 13.0pt;">}"</span></em>
</p>
<p> </p></li>
</ol></li>
<li><p>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.</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">call standalone.bat -c standalone.xml -b {ip-do-servidor} -Djboss.server.base.dir=..\standalone-node3 -Djboss.node.name=node3</pre>
</div>
</div>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"> From
the folder "apps", delete the file
"foundation-addon-indexer-web.war", which is from the Solr server;</span>
</p>
<p>
<span style="font-size: 10.0pt; line-height: 13.0pt;"><br /></span>
</p></li>
<li><p>
<span style="font-size: 10.0pt; line-height: 13.0pt;">Start
the first node with the script "node3.sh":</span>
</p>
<div class="code panel pdl" style="border-width: 1px;">
<div class="codeContent panelContent pdl">
<pre class="theme: Confluence; brush: html/xml; gutter: false"
style="font-size: 12px;">node3.bat</pre>
</div>
</div></li>
</ol>
<h1 id="FluigemLoadBalancecomMicrosoftNLB-ConfigurandooMicrosoftNLB">Configuring
Microsoft NLB</h1>
<p>There are 3 ports to be configured:</p>
<p> </p>
<p>7777 and 8888 for Fluig Realtime:</p>
<ul>
<li>Both should be in "Single" mode.</li>
<li>For <span
style="font-size: 10.0pt; line-height: 13.0pt;">more
information go to <a href="http://tdn.totvs.com/display/fluigeng/Configuring+Fluig+Realtime+for+execution+on+clusters">Configuring Fluig
Realtime for cluster execution</a>.
</span></li>
</ul>
<p>HTTP port for the Fluig Server</p>
<ul>
<li>This is usually either 8080 or just 80.</li>
<li>This door must be in the "Multiple mode" and "Single
affinity".</li>
</ul>
<p> </p>
<p>
<img class="confluence-embedded-image"
src="http://tdn.totvs.com/download/attachments/146180987/Config.png?version=1&modificationDate=1404149973000&api=v2"
data-image-src="http://tdn.totvs.com/download/attachments/146180987/Config.png?version=1&modificationDate=1404149973000&api=v2">
</p>
<p> </p>
</div>
|