Sunday, November 24, 2013

WSO2 Deployment synchronization on Windows environment

Deployment synchronization (dep-sync) is a feature that is shipped with most of the WSO2 products. This blog looks at how deployment synchronization can be achieved on carbon instances running on windows environment.

1.      Deployment synchronization requires SVNKit implementation from http://dist.wso2.org/tools/svnClientBundle-1.0.0.jar. This library has to be downloaded separately since it is not shipped with the WSO2 distribution.

2.      Once this SVN kit is downloaded copy the svnClientBundle-1.0.0.jar to {carbon_home}\repository\components\dropins folder on all the instances that artifacts need to be synchronized.

3.      In the Manager node open the {carbon_home}\repository\conf\carbon.xml and enable the dep-sync configuration as given below

     <DeploymentSynchronizer>
        <Enabled>true</Enabled>
        <AutoCommit>true</AutoCommit>
        <AutoCheckout>true</AutoCheckout>
        <RepositoryType>svn</RepositoryType>
        <SvnUrl>SVN URL</SvnUrl>
        <SvnUser>username</SvnUser>
        <SvnPassword>password</SvnPassword>
        <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
    </DeploymentSynchronizer>

4.      In the worker nodes use the following configuration to enable dep-sync in the {carbon_home}\repository\conf\carbon.xml file.
     
    <DeploymentSynchronizer>
        <Enabled>true</Enabled>
        <AutoCommit>false</AutoCommit>
        <AutoCheckout>true</AutoCheckout>
        <RepositoryType>svn</RepositoryType>
        <SvnUrl>SVN URL</SvnUrl>
        <SvnUser>username</SvnUser>
        <SvnPassword>password</SvnPassword>
        <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
    </DeploymentSynchronizer>

5.      Enable clustering in all instances by setting the clustering value as true in the {carbon_home}\repository\conf\axis2\axis2.xml.
<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">

Once the clustering is enabled, set a domain name so that all instances in the cluster will have the same domain name. Domain can be set as shown below.
 <parameter name="domain">wso2.carbon.domain</parameter>

Friday, November 22, 2013

Mounting WSO2 instances on a MS SQL Database which is secured via Windows authentication



A multi instance deployment of WSO2 products would require the registry (config and governance) space to be mounted on an external database.  WSO2 Products can be mounted on many types of databases. Below instructions explain how WSO2 products can be mounted on a MS SQL database that is secured via Windows Authentication.

1. download jTDS from the following link

2. Extract the folder and copy the jtds-1.2.2.Jar file to the {WSO2 Product}/components/lib folder

3. The extracted folder also includes ntlmauth.dll file in the \x64\SSO folder copy the dll file to java bin folder(C:\Program Files\Java\jre7\bin)

4. download and install the jdbc driver for mssql from the following location 

5. Once this is installed set the class path to the following location {JDBC driver Installation Path}\sqljdbc_4.0\enu\auth\x86

6. Make sure that the IP and the port is enabled at the MSSQL side, this can be verified through telnet.

7. Change the datasources.xml to the following configuration (Please change the DB name and the hostname accordingly)

<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
   <name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
   <configuration>
<url>jdbc:jtds:sqlserver://localhost:1433/testDB;integratedSecurity=true;</url>
<driverClassName>net.sourceforge.jtds.jdbc.Driver</driverClassName>
<maxActive>80</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
   </configuration>
</definition>
</datasource>

8. Start the ESB.