Thursday, December 13, 2012

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
 

Wednesday, October 10, 2012

How to grant permissions to edit etc/hosts file to all users

If you want to grant permissions to edit /etc/hosts file to all users without granting root permission,this is the simple way to do that.
log in to the system from root user and just enter,
"chmod a+w /etc/hosts"

Ex :

$ ls -la /etc/hosts
-rw-r--r-- 1 root wheel 236 Sep 23 2007 /etc/hosts
$ cat >> /etc/hosts
-bash: /etc/hosts: Permission denied
$ su admin
Password:
$ sudo chmod a+w /etc/hosts
Password:
$ exit
logout
$ ls -la /etc/hosts
-rw-rw-rw- 1 root wheel 241 Mar 9 15:37 /etc/hosts
$ cat >> /etc/hosts
test
$ tail -1 /etc/hosts
test

More infomation available at 
http://hintsforums.macworld.com/archive/index.php/t-99568.html 

Thursday, October 4, 2012

How to syncronize system clock with time servers

you can find the more information about NTP (Network Time Protocol) from here. But if you want to sync system time in your Linux machine. there's only two commands you need to execute.

1. First you have to install NTP. if you are using RHEL,
    do a "yum install ntp"
or if you are using ubuntu,
   "apt-get install NTP"

2. then execute "ntpdate 0.pool.ntp.org"

It will synchronize your system clock.