Giter Club home page Giter Club logo

db2-on-openshift's Introduction

Db2-on-OpenShift

Db2 on OpenShift 4.x

Run Db2 Community Edition on OpenShift on IBM Cloud.

This deployemnt recipe uses publicly available Db2 community edition from Docker Hub. The deployment will create a Statefulset using Block storage. This solution has been tested on IBM Cloud's OpenShift 3.11 and 4.3/stable.

oc new-project db2b
oc create serviceaccount db2b
oc adm policy add-scc-to-user privileged -n db2b -z db2b

Deploy

Change your zone/region before deploying.

oc create -f deploydb2.yaml

Use NodePort to connect to your database from outside.

Access container: oc rsh pod/db2-0 Change user: su - db2inst1.

A pre-installed database "books" can be tested by following these steps:

oc rsh pod/db2-0

su - db2inst1

db2 list database directory

db2 connect to books

curl -o create.sql https://raw.githubusercontent.com/aroute/db2books/master/create.sql
curl -o data.sql https://raw.githubusercontent.com/aroute/db2books/master/data.sql
curl -o drop.sql https://raw.githubusercontent.com/aroute/db2books/master/drop.sql

db2 -stvf create.sql > /dev/null
db2 -stvf data.sql > /dev/null

db2

select COUNT(*) author_count FROM authors;
list tables
SELECT COUNT(*) FROM books;
quit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.