Thursday, December 13, 2012

How to start H2 DB management tool in wso2 carbon servers

This guide will helps you how to view/operate H2 databases which embedded with the wso2 carbon servers.

1. Download wso2 products from here.
2. Open carbon.xml located in CARBON_SERVER/repository/conf
3.  Uncomment H2  db configuration (first 3 properties are the minimum requirement)

 <H2DatabaseConfiguration>  
    <property name="web" />  
    <property name="webPort">8082</property>  
    <property name="webAllowOthers" />  
    <!--  <property name="webSSL" />  
    <property name="tcp" />  
    <property name="tcpPort">9092</property>  
    <property name="tcpAllowOthers" />  
    <property name="tcpSSL" />  
    <property name="pg" />  
    <property name="pgPort">5435</property>  
    <property name="pgAllowOthers" />  
    <property name="trace" />  
    <property name="baseDir">${carbon.home}</property> -->  
 </H2DatabaseConfiguration>  


4. Start carbon server
5. Open bowser and enter "http://localhost:8082/" (if you change webport in above configuration, URL should be change based on that)
6. Add database informations as showed in pic1.
pic1



















 6. Now you will see H2 console.








Mediation statistics monitoring with WSO2 BAM

This tutorial will describes how to monitoring mediation statistics from WSO2 BAM. In here, I am using WSO2 BAM 1.3.2 and WSO2 ESB 4.0.3 to demonstrate the tutorial.

1. Download WSO2 ESB from here.
2. Download WSO2 BAM from here.

      As a first step ESB need to be configured to publish mediation statistics. "BAM mediation statistics data publisher" feature will be use to publish mediation statistics from ESB to BAM server. Following steps will guide you how to do that.

ESB Configuration

4. Log in to the ESB management console.
5. Before install mediation statistics feature, P2 repository need to be added to the wso2 ESB. You can find the carbon 3.2.3 P2 repository URL from here . Picture1 will show you how to add p2 repository.



6.  Then go to the "Available feature" tab and install "BAM Mediation Statistics Data Publisher" feature.









7. After install above feature restart the ESB server.

BAM Configuration

8. Now start BAM server and log in to the Management console.
10. Open Monitored server page inside the BAM configure menu.



















11.  Finally add server URL which you are going to monitor.
Ex :
   Server URL : https://localhost:9444
   Data Collection Method : Eventing
   Type of Data : mediation
   Subscription EPR : https://localhost:9443/services/BAMServerUserDefinedDataSubscriberService
   Username : admin
   password: admin
















12. If you able add new monitoring server successfully, You will be see added server in monitoring server page.






13. To test above create a proxy service in ESB and send a request. you will see mediation statistics data in BAM dashboard.


Wednesday, December 12, 2012

How to create JDBC mount with WSO2 Identity Server 4.0.0




Objective : Create a JDBC mount in between couple of IS instances to share governance artifacts.

To demonstrate I am using two wso2 IS instances and first instance call node1 and second one call node 2. Database will be MYSQL db as a common database.

1. As a First step create fresh mysql database [how-to]

Configure Node1 :

2. Go to the IS_HOME_NODE1/repository/conf/datasources directory and open the master-datasources.xml file

3. Update the url, username,password and driverClassName of the data source configuration.

<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:mysql://localhost:3306/reg_db</url>
<username>regadmin</username>
<password>regadmin</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
 
4. Open the axis2.xml and enable clustering. (IS_HOME_NODE1 /repository/conf/axis2)
<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">
5. Start IS node 1.

Configure IS node 2 :

1. Open the master-datasources.xml file. It is under IS_HOME_NODE2/repository/conf/datasources and add a new datasource configuration.

<datasource>
<name>WSO2_CARBON_DB_IS</name>
<description>The datasource used for registry</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB_IS</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://localhost:3306/reg_db</url>
<username>root</username>
<password>root</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>

2. Open the registry.xml file and add a new dbConfig for remote registry server.

<dbConfig name="wso2registry_registry">
<dataSource>jdbc/WSO2CarbonDB_IS</dataSource>
</dbConfig>
3. Add remote Registry instance to registry.xml.

<remoteInstance url="https://localhost:9443/registry">
        <id>instanceid</id>
        <dbConfig>wso2registry_registry</dbConfig>
        <readOnly>false</readOnly>
        <enableCache>true</enableCache>
        <registryRoot>/</registryRoot>
 </remoteInstance>
4. Add the mount configurations to registry.xml.

<mount path="/_system/config" overwrite="true">
    <instanceId>instanceid</instanceId>
    <targetPath>/_system/nodes</targetPath>
</mount> 
<mount path="/_system/governance" overwrite="true">
    <instanceId>instanceid</instanceId>
    <targetPath>/_system/governance</targetPath>
</mount>
5. Open the axis2.xml and enable clustering.

<clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true">
6. If both servers running on same machine change the port offset to different value of the carbon.xml

<Offset>1</Offset>
7. Start IS second node.

8. If configuration done successfully you will see the governance collection with symlink icon in IS node 2.


 
 
 
 




How to install Jenkins in ReadHat Server

I found great article of how to install Jenkins build manager in RHEL server.
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+RedHat+distributions