Skip to main content

Posts

Showing posts from 2014

Running multiple ActiveMQ instances on one machine

1. Download and unzip the ActiveMQ http://activemq.apache.org/ 2. Go to the ActiveMQ home directory and create the instances as follows cd <ACTIVEMQ_HOME> ./bin/activemq create instanceA ./bin/activemq create instanceB 3. Do ls -l you can see two sub directories created as instanceA and instance B 4. Let instanceA to use the default config, modify the config of instanceB Go to the instanceB/conf folder and open the file jetty.xml to make the webconsole available at port '8162'        <property name="connectors">             <list>                 <bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">                     <property name="port" value="8162" />                 </bean>             </list>         </property> 5. Open the activemq.xml file and modify tcp port to '61617'        <transport

Mounting remote governance registry

Let's say we have AS instance and G-reg instance, both instance have pointed their governance registry to MySql database. Now I want to mount the AS's governance registry to G-reg's /_system/as/governance path 1. Shutdown both instances 2. Configurations to be done in G-reg side (in registry.xml file) mount G-reg governance registry as <mount path="/_system/governance" overwrite="true">         <instanceId>greggov</instanceId>         <targetPath>/_system/governance</targetPath>     </mount> mount AS governance registry as <mount path="/_system/as/governance" overwrite="true">         <instanceId>asgov</instanceId>         <targetPath>/_system/as/governance</targetPath>     </mount> 3. Configuration to be done in AS side (in registry.xml file) mount AS governance registry <mount path="/_system/governance" overwrite="tr

Pointing governance registry to a MySQL database

Take WSO2 instance (here, I'm taking WSO2 AS) and do the following configurations 1. Modify the master-datasource.xml file <datasource>             <name>asgove</name>             <description>The datasource used for governance registry</description>             <jndiConfig>                 <name>jdbc/asgove</name>             </jndiConfig>             <definition type="RDBMS">                 <configuration>                     <url>jdbc:mysql://localhost:3306/asgove?autoReconnect=true</url>                     <username>root</username>                     <password>root</password>                     <driverClassName>com.mysql.jdbc.Driver</driverClassName>                     <maxActive>50</maxActive>                     <maxWait>60000</maxWait>                     <testOnBorrow>true</testOnBorrow>    

Why we need atleast 2 WKMs for WSO2 Product cluster

Assume we have an ELB cluster with 2 nodes connected to AS and ESB clusters. (Here the well known members are 2 ELBs) All nodes are connected and working fine (members joined the cluster). Let’s say, if both ELBs were down and then restarted, the ASs and ESBs also have to be restarted to join the cluster again. This is a known issue in Hazelcast. If all WK members fail, the entire cluster has to be restarted. Thats why they have recommend to have two WKs members at minimum. To avoid this situation you can configure the AS and ESB management nodes also as well-known members. Clustering details can found on AS[2] and ESB[3] links. [1] https://docs.wso2.com/display/CLUSTER420/Overview [2] https://docs.wso2.com/display/CLUSTER420/Clustering+Application+Server [3] https://docs.wso2.com/display/CLUSTER420/Clustering+ESB To configure AS & ESB mgt nodes as WK members, follow the following steps - Update the AS mgt node axis2.xml file with WK member details as f

Define HTTP endpoint in WSO2 ESB 4.6.0

WSO2 ESB 4.6.0 does not support the HTTP endpoint feature as 4.7.0. But we can send a HTTP GET request with query parameters using the property REST_URL_POSTFIX in ESB 4.6.0. Below proxy configuration in 4.6.0 will send a GET request with the query parameters defined in REST_URL_POSTFIX. <proxy xmlns=" http://ws.apache.org/ns/synapse " name="myProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">    <target>       <inSequence>          <property name="uri.var.site" value="33" scope="default" type="STRING"/>          <property xmlns:ns=" http://org.apache.synapse/xsd " name="REST_URL_POSTFIX"          expression="fn:concat('?site=', get-property('uri.var.site'), '&cm_user_pw=' ,12345 , '&account=' , 'accout' , '&key=' , 'test

How to configure api-key for the back-end service/API during the publishing process

This blog explains how to configure api-key for the back-end service/API during publishing process. The API key would be always constant. The scenario is: one user will register for the public API, obtain the non-expiring API-Key(let's call it as x-api-key) and publish that API on the WSO2 API Manager. Once the API is published the consumer of the API need not pass the x-api-key each time he/she is invoking the API, he/she only needs to pass the WSO2 Access Token and necessary parameters for the API. You can set the api-key as follows 1. Create custom sequence as follows and save it in a xml file. <sequence xmlns="http://ws.apache.org/ns/synapse" name="xxxxx"> <in> <header name="api-key" scope="transport" value="123456789"/> </in> </sequence> name the sequence as <API_NAME>:v<VERSION>--<DIRECTION> 2. login to the https://localhost:9443/carbon and add the xml file to t

Fronting WSO2 AS worker/manager cluster with HAProxy

This blog describes how to configure HAProxy as a load balancer with WSO2 Application Server cluster HAProxy 1.5 WSO2 Application Server 5.2.1 Setup WSO2 AS Cluster This cluster consist of 3 WSO2 Application Server instances, as 3 worker nodes and 1 manager node, where 1 node work as both worker and manager. HAProxy performs load balancing with this cluster by distributing incoming requests to the worker nodes via HTTP/S on port 80/443. All admin requests can be sent to the manager node directly via HTTPs on port 9444 or through the HAProxy via 443 port depending on how we configure the manager node. Click here  to see how to setup WSO2 Application Server cluster Setup HAProxy load balancer * Install HAProxy $ sudo add-apt-repository ppa:vbernat/haproxy-1.5 $ sudo apt-get update $ sudo apt-get install haproxy Need version 1.5 since native SSL support was implemented in 1.5 * Set ENABLED to 1 if you want the init script to star

Fronting WSO2 AS worker/manager cluster with Nginx

This Blog describes how to configure Nginx as a load balancer with WSO2 Application Server cluster Nginx 1.4.1 WSO2 Application Server 5.2.1 Setup WSO2 AS Cluster This cluster consist of 3 WSO2 Application Server instances, as 3 worker nodes and 1 manager node, where 1 node work as both worker and manager. Nginx performs load balancing with this cluster by distributing incoming requests to the worker nodes via HTTP/S on port 80/443. All admin requests can be sent to the manager node directly via HTTPs on port 9444 or through the Nginx via 443 port depending on how we configure the manager node. Click   here  to see how to setup WSO2 Application Server cluster Setup Nginx load balancer * Install Nginx $sudo apt-get install nginx * Locate the http{} block of the /etc/nginx/nginx.conf file and add the following # load balancing among the worker nodes - HTTP upstream wso2.as.com {              server as.wso2.com:9764;           server

WSO2 AS worker/manager cluster without WSO2 ELB

This blog describes how to setup WSO2 Application Server worker/manager cluster without using WSO2 Elastic Load Balancer and later we can use this cluster for configure different 3rd party load balances WSO2 Application Server - 5.2.1 1. Use Cases Each use case consist of 3 WSO2 AS instances form worker/manager cluster fronting with load balancer. Use Case 1: Requests direct to worker node cluster through LB No access to admin console through LB   Use Case 2: Requests direct to worker node cluster through LB. Allows to access admin console through LB. Use Case 3: Requests direct to worker node cluster through LB. Allows to access admin console through LB. Additionally manager node also serve requests. (Here manger node work as both worker and manager) Manager/Worker3 Worker1 Worker2 offset 1 2 3 localMemberPort 4100 4200 4300 http 9764 9765 9766 https 9444 9445 9446 2. Tips to configure 3