This blog post describes the steps you can follow in a situation where you have saved all your configurations in the embedded registry of your WSO2 Carbon server and suddenly the server is not starting due to some changes in the back end services and that changes has a direct impact on your configuration.
Let's say WSO2 ESB server is not starting due to some changes in the security policies which has applied in the WSDL files you are using in your proxy configurations. In this kind of a scenario, that particular proxy service will not be able start when the server starts. In the latest ESBs (WSO2 ESB 4.5.X onwards) server will start in failSafe mode by ignoring the failure of artifacts. But in older versions (ESB 1.x.x to 3.x.x) this feature is not available and the server will not start.
In this kind of scenario, you can't change your proxy configurations since you have saved them in the internal registry (which will save those data in internal H2 database).
Here is the steps you need to follow for changing artifacts in a scenario like this. You need to download compatible Governance Registry version for doing this.
You can follow this link to find out the corresponding GREG version.
http://wso2.com/products/carbon/release-matrix/
As an example, let's say you have ESB 2.1.3 installed in your system. From the above table you can find the Carbon version for that product is 2.0.3 and the corresponding GREG version is 3.0.3.
Please download GREG from the following link.
http://wso2.com/more-downloads/governance-registry (make sure you download the correct version)
1. First, make a backup of your system.
2. Copy the contents of ESB_HOME/database folder to GREG_HOME/database folder.
3. Change the carbon.xml file of GREG_HOME/conf such that you can view the H2 database viewer of the database as mentioned below.
<H2DatabaseConfiguration>
<property name="web" />
<property name="webPort">8083</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. Also change the management console ports of the GREG by editing following lines in GREG_HOME/conf/transports.xml file.
<transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
<parameter name="port">9764</parameter>
<transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
<parameter name="port">9444</parameter>
5. Now start the GREG by executing sh wso2server.sh command inside GREG_HOME/bin folder.
6. Create a folder called esb-artifacts inside GREG_HOME\bin directory and change the directory to that.
7. Checkout "/" from registry to this folder by executing following command within esb-artifacts folder.
sh ../checkin-client.sh co https://localhost:9444/registry/ -u admin -p admin
8. Now you can see all the configurations saved in the registry are fetched in to current folder.
9. Fix the proxy service which can be found in esb-artifacts/carbon/synapse-config/proxy-services folder.
10.Now check in the changes in to registry by executing the following command.
sh ../checkin-client.sh ci https://localhost:9444/registry/ -u admin -p admin
11. Browse H2 DBs REG_RESOURCES table and find the REG_CONTENT_ID for the proxy service which you have changed. Now find the content of that proxy service by selecting the REG_CONTENT_ID from REG_CONTENT table and find blob.
(You can access the H2 browser by http://localhost:8083 and login to the database with following parameters)
JDBC URL = jdbc:h2:GREG_HOME/database/WSO2CARBON_DB
username = wso2carbon
password = wso2carbon
12. Start the ESB with enabling H2 browser as mentioned in the Step 3 with a different port number (ex:8082).
13. Browse ESBs H2 DBs REG_RESOURCES table and find the REG_CONTENT_ID for the proxy service which you need to change. Now find the content of that proxy service by selecting the REG_CONTENT_ID from REG_CONTENT table and find blob.
(You can access the H2 browser by http://localhost:8083 and login to the database with following parameters)
JDBC URL = jdbc:h2:ESB_HOME/database/WSO2CARBON_DB
username = wso2carbon
password = wso2carbon
14. Copy BLOB content of the GREG in to same REG_RESOURCE in the ESB
15. Save (commit) the database change and restart the ESB.
now you can reflect the changes done in greg from the ESB itself. With the above method you can change the required configurations and save them in ESB registry and then restart the ESB successfully.
Let's say WSO2 ESB server is not starting due to some changes in the security policies which has applied in the WSDL files you are using in your proxy configurations. In this kind of a scenario, that particular proxy service will not be able start when the server starts. In the latest ESBs (WSO2 ESB 4.5.X onwards) server will start in failSafe mode by ignoring the failure of artifacts. But in older versions (ESB 1.x.x to 3.x.x) this feature is not available and the server will not start.
In this kind of scenario, you can't change your proxy configurations since you have saved them in the internal registry (which will save those data in internal H2 database).
Here is the steps you need to follow for changing artifacts in a scenario like this. You need to download compatible Governance Registry version for doing this.
You can follow this link to find out the corresponding GREG version.
http://wso2.com/products/carbon/release-matrix/
As an example, let's say you have ESB 2.1.3 installed in your system. From the above table you can find the Carbon version for that product is 2.0.3 and the corresponding GREG version is 3.0.3.
Please download GREG from the following link.
http://wso2.com/more-downloads/governance-registry (make sure you download the correct version)
1. First, make a backup of your system.
2. Copy the contents of ESB_HOME/database folder to GREG_HOME/database folder.
3. Change the carbon.xml file of GREG_HOME/conf such that you can view the H2 database viewer of the database as mentioned below.
<H2DatabaseConfiguration>
<property name="web" />
<property name="webPort">8083</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. Also change the management console ports of the GREG by editing following lines in GREG_HOME/conf/transports.xml file.
<transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
<parameter name="port">9764</parameter>
<transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
<parameter name="port">9444</parameter>
5. Now start the GREG by executing sh wso2server.sh command inside GREG_HOME/bin folder.
6. Create a folder called esb-artifacts inside GREG_HOME\bin directory and change the directory to that.
7. Checkout "/" from registry to this folder by executing following command within esb-artifacts folder.
sh ../checkin-client.sh co https://localhost:9444/registry/ -u admin -p admin
8. Now you can see all the configurations saved in the registry are fetched in to current folder.
9. Fix the proxy service which can be found in esb-artifacts/carbon/synapse-config/proxy-services folder.
10.Now check in the changes in to registry by executing the following command.
sh ../checkin-client.sh ci https://localhost:9444/registry/ -u admin -p admin
11. Browse H2 DBs REG_RESOURCES table and find the REG_CONTENT_ID for the proxy service which you have changed. Now find the content of that proxy service by selecting the REG_CONTENT_ID from REG_CONTENT table and find blob.
(You can access the H2 browser by http://localhost:8083 and login to the database with following parameters)
JDBC URL = jdbc:h2:GREG_HOME/database/WSO2CARBON_DB
username = wso2carbon
password = wso2carbon
12. Start the ESB with enabling H2 browser as mentioned in the Step 3 with a different port number (ex:8082).
13. Browse ESBs H2 DBs REG_RESOURCES table and find the REG_CONTENT_ID for the proxy service which you need to change. Now find the content of that proxy service by selecting the REG_CONTENT_ID from REG_CONTENT table and find blob.
(You can access the H2 browser by http://localhost:8083 and login to the database with following parameters)
JDBC URL = jdbc:h2:ESB_HOME/database/WSO2CARBON_DB
username = wso2carbon
password = wso2carbon
14. Copy BLOB content of the GREG in to same REG_RESOURCE in the ESB
15. Save (commit) the database change and restart the ESB.
now you can reflect the changes done in greg from the ESB itself. With the above method you can change the required configurations and save them in ESB registry and then restart the ESB successfully.
Comments
Post a Comment