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
 

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.

Tuesday, September 25, 2012

Thursday, September 20, 2012

How to run 32 bit bin files on top of the 64 bit ubuntu machine


This is the serious issue which i faced long time ago. I got a installation file which can install 32 bit operating systems. But i had to install it on top of my 64 bit ubuntu machine.every time it get failed.
           Then i installed 32 bit support libraries in to the 64 bit operating system with "apt -get installia32-libs" command.
After install above libraries i managed to run 32 bit bin file in my 64 bit ubuntu operating system.

Monday, June 18, 2012

How to restrict ssh to the linux users

If you want to restrict or allow particular user to do a ssh you need to take following steps. Based on your configuration it will allow or restrict to do a ssh to particular user/s.

1.  Open a sshd.config file
       " vi  /etc/ssh/sshd_config "
2.   if you want to allow to do a ssh for a particular user/users. you need to add below config to sshd_config file

      "AllowUsers user1 user2"
      Ex : "AllowUsers chamara menul sandya"

3.   if you want to deny to do a ssh for a particular user/users. you need to add below config to sshd_config file


     DenyUsers user1 user2"      
     Ex :   "DenyUsers chamara menul sandya"  
  
4.  Finally save the "sshd_config" file and restart the ssh service
     Ex : /sbin/service sshd restart  (only for a red hat servers)

Wednesday, May 2, 2012

How to connect Jprofiler with WSO2 Governance Registry

What is JProfiler?
       JProfiler is GUI enabled tool that used to measure performance based measurements such as CPU usage, memory bottlenecks and thread information etc, java based applications. more info

This article will demonstrate how JProfiler used to measure performance statistics in WSO2 Governance Registry. Same time this article applies to all carbon based products in WSO2.
     You can download any carbon based servers from wso2.org to execute this article. In here i am using WSO2 Governance Registry.

1. Download WSO2 Governance Registry
2. Download JProfiler from here.
3. Extract Jprofiler zip and if you are windows run jprofiler.exe or if you are in Linux environment run jprofiler.sh in /bin directory.

Now we need to create new jprofiler project to connect with the governance registry server. Below steps will guide you to create new JProfiler project.

4. Open JProfiler start center window by clicking on the start center button.


5. Click "New Remote Integration" button.

6 . Now profiled application need to locate. If you are locating application runs in same machine, you have to select "On this computer" option. If you are profiling remotely started application in other machine, you have to select "On a remote computer" option. In this article i will use first option.























7.  Now insert your JVM information.
 






















8. Then select profile setting transmission option.



9. Click next button in  JProfiler port setting window.



10.  Copy option text listed in "perform required modification" window and that need to be copy in your CARBON_HOME/bin/wso2server.sh or .bat file like below.





















11. Now start your governance registry and Jprofiler will connect with it.


Tuesday, January 31, 2012

Linux command of removing all .svn sub directories

Following steps will be help to remove all .svn directories

1. Open Linux terminal
2. Change the directory path to project folder.
3. Type below command.
  • find ./ -name ".svn" | xargs rm -rf