Friday, 9 December 2016

JCS - Create Storage Container for DB and JCS

Oracle JCS needs Oracle Database Cloud Service to install meta data information (OPSS and MDS schemas) for it's middleware components. Basically JCS gives a Java platform to deploy any Java EE aplications or Oracle FMW components like SOA, BPM, OBIEE, ADF etc. In order to do all these services JCS needs storage space. Oracle Database Cloud service also needs storage to store it's RDBMS files.

Oracle Storage Cloud service provides these in the form of containers. Containers are compartments where all files and unstructured data are stored. JCS Console does not provide any user interface to create these containers. You have to use REST API.

Basically creating storage containers is a two step process
  • Get Authentication token for the identity domain
  • Use Authentication token to create the containers.
Remember this authentication token is valid for 30 minutes after they have been retrieved.It's like OTP (One time password) you receive for doing any bank transactions over the net.

Let us create two containers mehabubDBContainer and mehabubJCSContainer using REST API.
You need tool to access REST API. I have user cURL. Use this link to install and access cURL.

Once you have installed cURL, it's time to select data center for your JCS. You do this by setting Replication Policy.

Log in to Myservices portal using https://cloud.oracle.com/en_US/sign-in and click on Storage from your services












Then from actions menu select Set Replication Policy



Select the data center and confirm the replication policy.

Once done you need to get the authentication key using the following CURL command
curl -i -X GET -H "X-Storage-User: Storage-<identitydomainname>:<user used for requesting service>" -H "X-Storage-Pass: <Password>" https://<identitydomainname>.storage.oraclecloud.com/auth/v1.0

For example 
curl -i -X GET -H "X-Storage-User: Storage-inibmmehabubjcs:mehabub.sheikh@in.ibm.com" -H "X-Storage-Pass: Aian@123" https://inibmmehabubjcs.storage.oraclecloud.com/auth/v1.0

You will get a reply



Note the authentication token under X-Auth-Token: and use it for creating containers like below

Create JCS Container:

curl -i -X PUT -H "X-Auth-Token: AUTH_tk6650960730b6b06b4db117e0908237c5" https://storage.us2.oraclecloud.com/v1/Storage-inibmmehabubjcs/mehabubJCSContainer

HTTP/1.1 201 Created
X-Trans-Id: txb0ee6d48012e4c3caf608-00583b0f5ega
Date: Sun, 27 Nov 2016 16:52:56 GMT
Connection: keep-alive
X-Last-Modified-Timestamp: 1480265566.57594
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Server: Oracle-Storage-Cloud-Service



Create DB Storage Container

curl -i -X PUT -H "X-Auth-Token: AUTH_tk6650960730b6b06b4db117e0908237c5" https://storage.us2.oraclecloud.com/v1/Storage-inibmmehabubjcs/mehabubDBContainer

HTTP/1.1 201 Created
X-Trans-Id: txf1a134d78cda4df28f8d1-00583b0f85ga
Date: Sun, 27 Nov 2016 16:53:25 GMT
Connection: keep-alive
X-Last-Modified-Timestamp: 1480265605.15221
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Server: Oracle-Storage-Cloud-Service



Now your containers are ready for use in Oracle DB Cloud Service and Oracle Java Cloud Service.
Follow the tutorials here from oracle which has detailed step by step instruction to provision your java cloud service.

Now there could a requirement to automate this process of creating containers, Database Cloud service and Java Cloud service. Oracle has a wonderful blog which details the automation script you can use for your requirements.

 Happy Learning..........