Showing posts with label part. Show all posts
Showing posts with label part. Show all posts

Thursday, June 29, 2017

Debt Collector Marilyn Manson Part 1

Debt Collector Marilyn Manson Part 1


Jeff here! New chapter is up!
Batoto link

Read more »

Monday, June 12, 2017

Deploy your own Enterprise Store part 3

Deploy your own Enterprise Store part 3


I will discuss about few UI modifications you can do to make your own Music Store(or whatever) from what you have deployed, using WSO2 ES while following previous blog posts.You can find previous posts from [1] and [2].

At the moment we have our own mp3 asset type plus few other default asset types (gadget, site, e-book) in the ES.


First Im going to hide all default asset types from the Store UI, there are number of ways to accomplish this task.

1. Get a fresh WSO2-ES pack and remove all default asset rxts , asset types from store-tenant.json, publisher-tenant.json files while adding our new mp3 asset.

2. By modifying  /_system/config/store/configs/store.json in our registry. You can find this under Resources > Browse > _system > config >store > configs in our management console https://localhost:9443/admin/carbon/admin/login.jsp.

Under content menu you can update store.json with the following content by pressing Edit as text. We are going to remove all default asset types from the config.
{
"assets": [
"mp3"
],
"assetsPageSize": 12,
"commentsPageSize": 10,
"userSpace": "/_system/governance/users",
"roles": {
"Internal/store": {
"/permission/admin/login": [
"ui.execute"
]
}
},
"userRoles": [
"Internal/store"
],
"permissions": {
"login": {
"/permission/admin/login": [
"ui.execute"
]
}
},
"paths": {
"RXT_EXTENSION_PATH": "/config/ext/"
}
}
Just save it and browse our store http://localhost:9763/store/



You can update the icon-sprite.png resides under repository/deployment/server/jaggeryapps/store/extensions/assets/mp3/resources/  with a suitable one for our MP3 store.

Without writing a single line of code we can configure our simple digital asset store by using WSO2 ES :)

[1]. http://udarakr.blogspot.com/2013/11/deploy-your-own-enterprise-store-part-1.html
[2]. http://udarakr.blogspot.com/2013/11/deploy-your-own-enterprise-store-part-2.html
Read more »

Friday, May 19, 2017

Deploy your own Enterprise Store part 1

Deploy your own Enterprise Store part 1


Why enterprise store?

We are living in a digital-era where we create and use thousands of digital assets. There are number of tools around us to create assets, but very few resources we have to store, publish, maintain which bring immense value addition to our digital assets. This is the enterprise wide problem solved by the WSO2 Enterprise Store. Organize your assets at one place, access from everywhere !!

ES powered by two major apps, store and publisher. Lets talk about the publisher first. As the back office of the store, publisher is the platform which create, manage life-cycle and monitor statistics of assets. You can provision those published assets though the store front-end.

Lets dive in-to the ES world by running the product, first download the WSO2 ES product from here and unzip the product.You can find following directory structure inside the ES.

??? bin
??? dbscripts
??? INSTALL.txt
??? lib
??? LICENSE.txt
??? modules
??? README.txt
??? release-notes.html
??? repository
??? resources
??? tmp
??? webapp-mode
Here Im working in a linux environment, you can follow official installation guide here if you are using/familiar with any other environment.

Navigate to the bin directory and start the server using following commands within your terminal window.
cd bin/
sh wso2server.sh 
Once the server started you can browse,

Store URL : http://localhost:9763/store
Publisher URL : http://localhost:9763/publisher
Mgt Console URL  : https://localhost:9443/admin/carbon/


Use the following default user credentials to login, or else you can create your own user.

username : admin
password : admin

By default ES 1.0.0 shipped with provision for gadgets, websites and eBooks, you can browse, search, download or bookmark, manage life-cycle, view stats of those default digital assets in this ES installation.

Few screen-shots from the ES 1.0.0.

Store home

Site-Asset home


Sample- FaceBook asset page

In the following screen-shot you can find out some interesting social features of the WSO2 ES such as commenting, rating and tagging of assets.



Store-My items page

This is where you can see all assets that you have either download or bookmark from the store.


Publisher home

Asset Statistics

This is where you one can get a insight of his/her assets.
Number of bookmarks/downloads per asset, number of bookmarks/downloads during given period of time etc.


Asset Life-cycle management

Add new asset(gadget asset type)

Lets talk about how to install your own digital asset(rather than using gadgets,sites and e-books) in coming blog post.

If you wish to contribute to the WSO2 Enterprise-Store Product, yes its on github. You can clone ES from here and play/contribute with/to the source.
Read more »

Thursday, May 18, 2017

Debt Collector part 4

Debt Collector part 4


Jeff here! New chapter!
Batoto link

Read more »

Sunday, May 14, 2017

Debt Collector Marilyn Manson Part 5 and 6

Debt Collector Marilyn Manson Part 5 and 6


Jeff here! Got two new chapters!
Batoto link


Read more »

Friday, April 28, 2017

DB2 Q Replication setup for an active active solution PART 2

DB2 Q Replication setup for an active active solution PART 2


Im back after my 5 day continuous night shifts.. Its Saturday today fresh day to start with PART 2 to quick setup of DB2 Q Replication for active active solution

We have installed DB2 on Fedora box in PART 1 , now let us install Websphere MQ on top of it.

Installation of Websphere MQ 7.1 :


1) Untar the installation files
tar -xvf WMQ_7.1.0.3_TRIAL_LNX_X86_64_ML.tar.gz


2) we need to accept the license before proceeding for installation of MQ
sudo ./mqlicense.sh -accept


3) Now lets install Websphere MQ using below command
rpm -ivh MQSeries*


4) After MQ installed we need to set the current installation as primary for that we need to run setmqinst command from installation path like below.
sudo ./mqsetinst -i -p /opt/mqm
After it executes we should see this messages like below.


[db2inst1@fedorabox bin]$ sudo ./setmqinst -i -p /opt/mqm/

114 of 114 tasks have been completed successfuly.

Installation1 (/opt/mqm) set as the Primary Installation.

5) Run command dspmq to see installed version of MQ

[db2inst1@fedorabox bin]$ dspmqver


Name:        WebSphere MQ
Version:     7.1.0.3
Level:       p710-003-130724
BuildType:   IKAP - (Production)
Platform:    WebSphere MQ for Linux (x86-64 platform)
Mode:        64-bit
O/S:         Linux 3.6.10-4.fc18.x86_64
InstName:    Installation1
InstDesc:    
InstPath:    /opt/mqm
DataPath:    /var/mqm
Primary:     Yes
MaxCmdLevel: 711

If this MQ installation is not first time on your machine, you need to run crtmqpkg command to create unique set of packages to install in your system. In order to do this we need to install pax before running crtmqpkg command

sudo apt-get install pax
sudo ./crtmqpkg PROD
after the packages are created a path is displayed where those are created we need to go to that directory and install the available RPMs for MQ .
cd /var/tmp/mq_rpms/PROD/

sudo crtmqpkg test  
sudo rpm -ivh MQSeries*


================= End of installation Websphere MQ ===========================

A prerequisite for using Q Replication is that databases should be enabled for archive logging. use below script that creates a database , setup archive logging, and take an offline backup . see that you create the needed directories that used for archive log location, Put it everything in a file and run it.

create database testa;
create database testb;
update db cfg for testa using LOGARCHMETH1 DISK:/home/db2inst1/archivelogs/testa;
backup database testa to /dev/null;
update db cfg for testb using LOGARCHMETH2 DISK:/home/db2inst1/archivelogs/testb;
backup database testb to /dev/null;

db2 -stvf create.sql -z create.out

Now lets create Queue Manager and it objects. Use below script

ASNCLP SESSION SET TO Q REPLICATION;
CREATE MQ SCRIPT CONFIG TYPE B
MQSERVER 1 NAME TESTA MQHOST "fedorabox" MQPORT 2416 QMANAGER QMTA QNAME_QUAL ASNTA, 
MQSERVER 2 NAME TESTB MQHOST "fedorabox" MQPORT 2417 QMANAGER QMTB QNAME_QUAL ASNTB; 

Change the "fedorabox" hostname to your machine name. 

Important points to understand here:

CREATE MQ SCRIPT command will generate scripts for creating all of the WebSphere MQ objects that are needed for Q Replication. Lets run the script using asnclp command line, Once done we can see 4 files created 2 files ending with .sh is for unix/linux OS , 2 files ending with .bat is for windows OS.

[db2inst1@fedorabox scripts]$ asnclp -f create_mq_objects.asn


[db2inst1@fedorabox scripts]$ ls -lrt
total 40
-rw-rw-r--. 1 db2inst1 db2inst1  240 Apr 12 19:49 create_mq_objects.asn
-rw-rw-r--. 1 db2inst1 db2inst1 5329 Apr 12 19:50 qrepl.testa.mq_windows.bat
-rw-rw-r--. 1 db2inst1 db2inst1 5330 Apr 12 19:50 qrepl.testa.mq_aixlinux.sh
-rw-rw-r--. 1 db2inst1 db2inst1 4671 Apr 12 19:50 qrepl.testb.mq_windows.bat
-rw-rw-r--. 1 db2inst1 db2inst1 4666 Apr 12 19:50 qrepl.testb.mq_aixlinux.sh
-rw-rw-r--. 1 db2inst1 db2inst1  412 Apr 12 19:50 qreplmsg.log

Now switch to mq user and run the 2 files one for testa other for testb.

sh qrepl.testa.mq_aixlinux.sh
sh qrepl.testb.mq_aixlinux.sh

After running that we should be able to see there are 2 Queue managers that should up and running as show below.

[db2inst1@fedorabox mqm]$ dspmq
QMNAME(QMTA)                                              STATUS(Running)
QMNAME(QMTB)                                              STATUS(Running)

Lets create a table named "dba" with columns as below and run on both the databases TESTA and TESTB. 

[db2inst1@fedorabox scripts]$ db2 connect to testa
   Database Connection Information
 Database server        = DB2/LINUXX8664 9.7.6
 SQL authorization ID   = DB2INST1
 Local database alias   = TESTA
[db2inst1@fedorabox scripts]$ db2 "create table dba(id num not null,name varchar(10), topic varchar(10))"
DB20000I  The SQL command completed successfully.
[db2inst1@fedorabox scripts]$ db2 "alter table dba add primary key(id)"
DB20000I  The SQL command completed successfully.


[db2inst1@fedorabox scripts]$ db2 connect to testb
   Database Connection Information
 Database server        = DB2/LINUXX8664 9.7.6
 SQL authorization ID   = DB2INST1
 Local database alias   = TESTB


[db2inst1@fedorabox scripts]$ db2 "create table dba(id num not null,name varchar(10), topic varchar(10))"
DB20000I  The SQL command completed successfully.
[db2inst1@fedorabox scripts]$ db2 "alter table dba add primary key(id)"
DB20000I  The SQL command completed successfully.


Now we use below script to create control tables,replication queue maps and a sample subscription for table DBA.


Important points to understand here:


create control tables statement will create control tables which store information about Q replication and its sources and targets.
create replqmap statement will create replication queue maps which are needed to identify websphere mq queues on both the servers that is source and target. One replication queue map defined from source to target and one for target to source.
create qsub statement will create a queue subscription that maps source table to target table.


ASNCLP SESSION SET TO Q REPLICATION;
SET OUTPUT MULTIDIR;
SET RUN SCRIPT NOW STOP ON SQL ERROR ON;
SET BIDI NODE 1 SERVER DBALIAS TESTA ID "DB2INST1" PASSWORD "db2inst1" SCHEMA ASNTA;
SET BIDI NODE 2 SERVER DBALIAS TESTB ID "DB2INST1" PASSWORD "db2inst1" SCHEMA ASNTB;
SET QMANAGER QMTA FOR NODE 1;
SET QMANAGER QMTB FOR NODE 2;
CREATE CONTROL TABLES FOR NODE 1;
CREATE CONTROL TABLES FOR NODE 2;
CREATE REPLQMAP "TESTA.ASNTA_TO_TESTB.ASNTB" (NODE 1, NODE 2);
CREATE REPLQMAP "TESTB.ASNTB_TO_TESTA.ASNTA" (NODE 2, NODE 1);
SET TABLES(NODE 1 "DBA");
CREATE QSUB SUBTYPE B FROM NODE TESTA.ASNTA SOURCE HAS LOAD PHASE I START AUTOMATICALLY YES TARGET LOAD TYPE 0;


Now run the script using asnclp command line 

asnclp -f replication_setup.asn

This will  create control tables, replication queue map and subscription for table DBA. Once done with above script now lets start the capture and apply programs on both sides.

Issue this commands using db2inst1 ID

nohup asnqcap capture_server=TESTA capture_schema=ASNTA &
nohup asnqcap capture_server=TESTB capture_schema=ASNTB &
nohup asnqapp apply_server=TESTA apply_schema=ASNTA &
nohup asnqapp apply_server=TESTB apply_schema=ASNTB &


Lets replicate the data now, Insert data from TESTA and look if its replicated to TESTB database.


[db2inst1@fedorabox mqm]$ db2 connect to TESTA
   Database Connection Information
 Database server        = DB2/LINUXX8664 9.7.6
 SQL authorization ID   = DB2INST1
 Local database alias   = TESTA


[db2inst1@fedorabox mqm]$ db2 "insert into dba values(1,Murali,db2)"
DB20000I  The SQL command completed successfully.


[db2inst1@fedorabox mqm]$ db2 "select * from dba"
ID      NAME       TOPIC  
------- ---------- ----------
     1. Murali     db2    
  1 record(s) selected.


[db2inst1@fedorabox mqm]$ db2 connect to testb
   Database Connection Information
 Database server        = DB2/LINUXX8664 9.7.6
 SQL authorization ID   = DB2INST1
 Local database alias   = TESTB


[db2inst1@fedorabox mqm]$ db2 "select * from dba"
ID      NAME       TOPIC  
------- ---------- ----------
     1. Murali     db2    
  1 record(s) selected.


So the data is replicating and we just did it.... :) thats all with this tutorial on DB2 Q Replication.



In my next post i will post the common issues that i have encountered when did my first setup of Q Replication. People post your comments here ..... and lets start exploring more on Q Replication.

Read more »

Sunday, April 9, 2017

DB2 Q Replication setup for an active active solution PART 1

DB2 Q Replication setup for an active active solution PART 1


How to setup DB2 Q Replication

We are about a setup DB2 Q Replication that demonstrates active active solution. Active - Active  simply means changes happening at source should go to target and at same time changes happening at target should go to source.

High level steps:

1) Install DB2 9.7 on Fedora 18 OS - Im Fedora OS as its free edition supported by REDHAT community.
2) Install Websphere MQ 7.1 for messaging system between 2 DB2 databases.
3) Create MQ objects needed for active active Q replication.
4) setup a replication for a sample table to demonstrate active active replication.

Below is the setup of two databases named TESTA and  TESTB for demonstration of active - active Q replication between two db2 databases. Below is how the setup look like.



Links to download the needed softwares

1) Fedora 18 or above ( Free copy ) from here :- http://fedoraproject.org/en_GB/get-fedora-all

2) DB2 9.7 AESE ( trail 90 days ) from here https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_us&source=swg-dm-db297trial&S_CMP=web_dw_rt_swd

3) Websphere 7.1 (trail 90 days ) from here :- www.ibm.com/webspheremq/downloads

Installation procedure of DB2 9.7 on Fedora OS

After installing fedora and Vmware tools you will be able to copy the downloaded trails files to the host machine to proceed with installation. An advice here when you try to copy to host machine, Use the command with sudo access ( systemctl mask tmp.mount ), This will turn off any filesystem from being mounted on /tmp, forcing it to be on / instead. To turn it on again, run ( systemctl unmask tmp.mount )

1) Its always a best practice to do a prerequisite check before installing DB2

[db2inst1@fedorabox server]$ cd server/
[db2inst1@fedorabox server]$ sudo sh db2prereqcheck
[sudo] password for db2inst1:
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
WARNING:
   The 32-bit library file libpam.so is not found on the system.

Above you can see that there is a warning that libpam.so is missing. Now lets install it from internet. run sudo yum install pam-devel.i686   in your terminal

Ok lets run the prereqcheck again and see.

[db2inst1@fedorabox server]$ sudo sh db2prereqcheck
[sudo] password for db2inst1: 
WARNING:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
above warning can be ignored.

2) now lets install the db2 using db2setup

[db2inst1@fedorabox server]$ sudo sh db2setup

we get a GUI prompt like ( shown below ) which will allow us to use various options for installation, Just go ahead proceed with all steps and at the end when you click finished , it will do the actual work of installing DB2 with the selected options 



When all the steps are completed lets set the db2profile in user home directory add below 3 lines to profile file of db2inst1 ( run vi .bash_profile )

if [ -f /home/db2inst1/sqllib/db2profile ]; then
        sh /home/db2inst1/sqllib/db2profile
fi

execute the profile file to take changes into effect 
run       . .bash_profile 

3) Now lets start the instance.

[db2inst1@fedorabox ~]$ db2start
04/07/2014 15:17:17     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.

Thats it with DB2 Installation on Fedora OS and we can proceed to step 2 which will be preceded in the next post as PART 2

Read more »