Coder Social home page Coder Social logo

db2-docker's Introduction

The README file can be found in db2-install/expc/README.md

db2-docker's People

Contributors

alandmandatprof avatar angoca avatar grange74 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

db2-docker's Issues

kubernetes yaml for this docker image.

It would be good if the kubernetes yaml file for this image is documented somewhere. I am trying to use this with kubernetes and mount a persistent volume for the /home directory.

DB2 Not Starting - SQL1042C

Hello @angoca, first of all, thanks for all our contributions to the DB2 community, I'm using all your Nagios scripts to monitor db2.

I've tried to use your container but DB2 isn't starting at all

 db2inst1@c53ab027d2dc:~$ db2start
 SQL1042C  An unexpected system error occurred.

DB2 Diag logs:

2016-02-05-21.17.53.231400+000 I17824E382            LEVEL: Warning
PID     : 8012                 TID : 140638486521728 PROC : db2start
INSTANCE: db2inst1             NODE : 000
HOSTNAME: c53ab027d2dc
FUNCTION: DB2 UDB, base sys utilities, sqleReleaseStStLockFile, probe:14796
MESSAGE : Released lock on the file:
DATA #1 : String, 39 bytes
/home/db2inst1/sqllib/ctrl/db2strst.lck

In fact, I've tried your container because I'm facing the same issue on my project, a ansible role to install, configure and create DB2 databases. The issue is faced only when tested on docker.

My docker host is VMware Photon OS

Do you know what this could be?

ERRORCODE=-4499, SQLSTATE=08001

Hi,
I install the image unprivileged on port 50001:
docker run -it --ipc="host" --cap-add IPC_LOCK --cap-add IPC_OWNER --name="db2inst1" -p 50001:50000 angoca/db2-install
In the container I exec createInstance.

When I try to connect with squirrel to db2 result in the error in the object.
url: jdbc:db2://localhost:50001/db2c_db2inst1

I use Mac.

can you tell me what I wrong?
thans

Trying to start angoca/db2-instance:instance-server_t

sudo docker run -i -t --privileged=true --name="db2inst1" -p 50000:50000 -v /tmp/db2:/home angoca/db2-instance:instance-server_t. I get:
exec: "db2": executable file not found in $PATH2015/02/17 14:28:14 Error response from daemon: Cannot start container 65c8c962f0295984be08c0c119a5a2e99c6c686b088bde64f547ff8d7562d93e: exec: "db2": executable file not found in $PATH
Any idea what might be wrong?

Advantages of this image

The most recent version of DB2, not an old Fixpack
Based on Ubuntu, a supported distribution (CentOS is not supported)

Reduce the size of the docker images by combining RUN commands

First of all great work on this repo and for helping DB2 being more user friendly.

Something i did notice which could be improved is the size of the images. For example the base install one is around 3GB according to https://imagelayers.io/?images=angoca%2Fdb2-install:latest.

You should be able to great reduce this size by combining some RUN commands. It does make the Dockerfile a little less readable but you have plenty of comments should it should be ok and the reduction should be worth it.

A good start would be to combine commands that download and ones that delete the downloaded file. If you do this in separate run commands the file won't be accessible in the above layers but it will still be there physical in the download layer.

So for example combine:

# Download the installer.
## URL to download the installer. The link is obtained from an article in the Wiki
## https://github.com/angoca/db2-docker/wiki/db2-link-expc
## That article should contain a valid link as the last line.
## If the link is not valid, you can modify the wiki.
RUN /tmp/download

# Extract the installer and delete the tar file.
RUN cd /tmp && \
  tar -zvxf ${DB2_INSTALLER} && \
  rm ${DB2_INSTALLER}

to:

# Download the installer.
## URL to download the installer. The link is obtained from an article in the Wiki
## https://github.com/angoca/db2-docker/wiki/db2-link-expc
## That article should contain a valid link as the last line.
## If the link is not valid, you can modify the wiki.
# Extract the installer and delete the tar file.
RUN /tmp/download && \
  cd /tmp && \
  tar -zvxf ${DB2_INSTALLER} && \
  rm ${DB2_INSTALLER}

This should reduce the image by around 595MB.

Supposed lifecycle

Hello! I do not know docker well yet, but from what I learned, one cannot "re-run" a container.
So, from my perspective which is probably wrong, there are but two approaches to using "db-instance".

  1. We run the image, thus producing a container. There in a shell we execute .\createInstance, which makes some changes to a running container. Then we stop a container (say, our host machine needs to be shut down), and all the changes are lost, since we did not commit them. Then after power-on we remove the container, and once again "run" the image. This approach works fine, but it's both clumsy since the necessity to manually remove dead containers, and likely useless since no one will want to use enterprise grade database with no data persistence :)
  2. We run the image, thus producing a container; with that command, we also specify options to mount data volumes for database storage. Then in a container shell we execute .\createInstance, which makes some changes to a running container. We then commit the container, so that in the future we can just "start" it from that point and it will "resume" servicing the database. Since the database itself resides in a mounted data volume, it is persistent.

Is there another way to use the image AND provide persistense? Without using "commit", every time we "run" or "start" the image, the container will be in an "initial" state: no user created, no db2start on a path, etc; worse, createInstance fails if the database already exists. Say, I would like to simply start up a DB2 TCP server and use the database created in a previous "run"; I start it, but now I cannot use createInstance! Well, I can and it even does something, but the TCP server is not started, and somewhere along the way I see an error message about database already being there. I suppose I could simply use db2start but it's not on a path and I am not even sure the container is ready to use it in this state, maybe it still requires some preparations, like creating a user.

In principle, the (2) approach works for me. It's bad from the automation point of view, though: I will have some script on a first run to run the image with keeping stdin open, and DON'T wait for completion lest the wait will be infinite; but, not waiting for completion, I will still want to wait for completion, to understand when it's time to (automatically, not manually) commit the container and maybe stop it. Or, I could have the script run the image without keeping stdin open and wait for completion, that's much easier, but this stores in a config that "this container does not require keeping stdin open", and when later I "start" it, guess what? it simply shuts down by itself, since no commands come from the user ("start -a -i" does not help). And if there is a way to "run" the container without "-t -i" and then somehow turning them ON in config for subsequent "start", I am not aware of it :(

Maksim

db2start wont start

Hi,
I'm just running your docker image for the first time. The createInstance script runs db2isetup fine, but then the db2start command fails.
I've logged at the /tmp/db2isetup.log and there is no indication of failure there.
Wondered if you could give me any clues ?
Thanks for your help,
Peter

sudo docker run -i -t --privileged=true --name="db2inst1" -p 50000:50000 angoca/db2-instance
root@5a5150c2bf17:/tmp/db2_conf# ./createInstance
The execution completed successfully.

For more information see the DB2 installation log at "/tmp/db2isetup.log".
SQL1042C An unexpected system error occurred.

License is expired

db2inst1@6f14ccec1439:~$ db2licm -l
Product name:                     "DB2 Advanced Enterprise Server Edition"
Expiry date:                      "Expired"
Product identifier:               "db2aese"
Version information:              "11.1"
Enforcement policy:               "Soft Stop"

Product name:                     "DB2 Enterprise Server Edition"
Expiry date:                      "Expired"
Product identifier:               "db2ese"
Version information:              "11.1"
Enforcement policy:               "Soft Stop"

Product name:                     "DB2 Advanced Workgroup Server Edition"
Expiry date:                      "Expired"
Product identifier:               "db2awse"
Version information:              "11.1"
Enforcement policy:               "Soft Stop"

Product name:                     "DB2 Workgroup Server Edition"
Expiry date:                      "Expired"
Product identifier:               "db2wse"
Version information:              "11.1"
Max amount of memory (GB):        "128"
Max number of cores:              "16"
Enforcement policy:               "Soft Stop"

Product name:                     "DB2 Direct Advanced Edition"
Expiry date:                      "Expired"
Product identifier:               "db2dae"
Version information:              "11.1"

Product name:                     "DB2 Direct Standard Edition"
Expiry date:                      "Expired"
Product identifier:               "db2dse"
Version information:              "11.1"
Max amount of memory (GB):        "128"
Max number of cores:              "16"

Product name:                     "IBM DB2 Developer-C Edition"
Expiry date:                      "Expired"
Product identifier:               "db2dec"
Version information:              "11.1"

Product name:                     "dashDB"
Expiry date:                      "Expired"
Product identifier:               "dashdb"
Version information:              "11.1"
Enforcement policy:               "Soft Stop"

Could you update license or provide instruction how to change it?

db2start throws SQL1042C An unexpected system error occurred.

Trying to deploy on Mac (macOS High Sierra)

Created a /db2 folder on the host, added /db2 mount point via Docker - Preferences

Ran the following -
docker run -i -t --privileged=true --name="db2inst1" -p 50000:50000 -v /db2:/home angoca/db2-instance

./createInstance
su - db2inst1
. ~db2inst1/sqllib/db2profile
su - db2inst1

db2inst1@ace6e0af1103:~$ db2start
SQL1042C An unexpected system error occurred.

db2 diag log shows -

2017-12-13-19.41.42.838165+000 E7247E1026 LEVEL: Error (OS)
PID : 7930 TID : 140601058523008 PROC : db2star2
INSTANCE: db2inst1 NODE : 000
HOSTNAME: ace6e0af1103
FUNCTION: DB2 UDB, oper system services, sqloopenp, probe:80
MESSAGE : ZRC=0x870F0002=-2029060094=SQLO_BPSE "Debug logic error detected"
DIA8501C A buffer pool logic error has occurred.
CALLED : OS, -, open OSERR: EINVAL (22)
DATA #1 : Codepath, 8 bytes
5:11:18:20:24:40
DATA #2 : File name, 55 bytes
/home/db2inst1/sqllib/ctrlha/.db2.000.ace6e0af1103.pgrp
DATA #3 : SQO Open File Options, PD_TYPE_SQO_FILE_OPEN_OPTIONS, 4 bytes
SQLO_CRTREV, SQLO_READWRITE, SQLO_SHAREWRITE, SQLO_FORCE_NON_BUFFERED, SQLO_WRITETHRU, SQLO_SECURE
DATA #4 : Hex integer, 4 bytes
0x000001B4
DATA #5 : signed integer, 4 bytes
0
DATA #6 : Hex integer, 4 bytes
0x00004000
DATA #7 : String, 105 bytes
Search for ossError*Analysis probe point after this log entry for further
self-diagnosis of this problem.

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.