IBM Support

docker-informix实践

Question & Answer


Question

docker-informix如何工作

Cause

探寻docker-informix的参考

Answer

基于Debian/Ubuntu 的docker container with IBM Informix Dynamic Server。

Informix数据库服务器提供的版本,包括免费的开发者版本,为小型和中型企业版本,版本支持完整的特性集和最大的设计用于支持企业应用程序。如果你对选用哪个版本的Informix感到困惑,请参见Informix12.1不同版本的特性描述。

Informix通常被认为是低成本高优化零管理的高效易用数据库,包括用作嵌入式数据库。它具有稳定性高,长时间的维持很高的事务支持率等等。因此,Informix被广泛部署在零售业,在店内的低管理开销很有用的部署。

建立Informix container image (Ubuntu host)

## 去除标准的Ubuntu Docker 安装


sudo apt-get purge docker.io
curl -s https://get.docker.io/ubuntu/ | sudo sh

## 生成 enviroment for docker-informix container build
mkdir informix_build
cd informix_build
git clone https://github.com/0x1fff/docker-informix.git

## 下载IBM Informix 安装文件并完成拷贝
cp iif.*.linux-x86_64.tar .

## 启动 HTTP server with Informix image
python -m SimpleHTTPServer 9090 &
PY_HTTP=$!

## Build docker image (Dockerfile may require minor changes)
sudo docker build -t docker-informix docker-informix

## Shutdown HTTP server
kill $PY_HTTP

启动 Informix container (Ubuntu host)

在端口90088上部署Informix

sudo docker run -it -v "/home/informix/data/" -p 9088:9088 --name informix docker-informix

生成一个空的database: "test"

sudo docker run -it -v "/home/informix/data/" -p 9088:9088 --name informix -e DB_USER=test -e DB_PASS=test -e DB_NAME=test docker-informix

创建container (Informix Database)

johny@ThinkPad:~/$ docker ps -a


CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
00e73b00c498 docker-informix:latest "/bin/bash" About an hour ago Exited (0) 6 seconds ago informix

johny@ThinkPad:~/$ docker start 00e73b00c498
00e73b00c498

johny@ThinkPad:~/$ docker attach 00e73b00c498

IDS-12.10 dev:
IDS-12.10 dev:
IDS-12.10 dev:

连接Informix数据库

对于连接到Informix数据库可以使用SQLWorkbench / J与额外的Informix JDBC驱动程序的包或单独从IBM Informix JDBC驱动程序下载页面下载IBM Informix JDBC Driver Download Page.

JDBC连接串如下:

jdbc:informix-sqli://127.0.0.1:9088/test:INFORMIXSERVER=dev;user=test;password=test;CLIENT_LOCALE=en_US.utf8;DB_LOCALE=en_US.utf8

对于Docker (仅对于x86_64版本)可用的informix版本如下:

· 12.10FC4TL - Informix Enterprise Time-Limited Edition for Linux x86_64 (iif.12.10.FC4TL.linux-x86_64.tar)

· 12.10FC4DE - Informix Developer Edition for Linux x86_64 (iif.12.10.FC4DE.linux-x86_64.tar)

· 12.10FC4IE - Informix Innovator-C Edition for Linux x86_64 (iif.12.10.FC4IE.linux-x86_64.tar)

· 11.70FC8DE - Informix Developer Edition for Linux x86_64 (iif.11.70.FC8DE.linux-x86_64.tar)

· 11.70FC8IE - Informix Innovator-C Edition for Linux x86_64 (iif.11.70.FC8IE.linux-x86_64.tar)

· 11.50FC9DE - Informix Developer Edition for Linux x86_64 (iif.11.50.FC9DE.linux-x86_64.tar)

Informix Version (x86_64)
Ubuntu 14.10
Ubuntu 14.04
Debian 7 (wheezy)
12.10.FC4 Time Limited
12.10.FC4 Innovator Edition
12.10.FC4 Developer Edition
11.70.FC8 Developer Edition
11.70.FC8 Innovator Edition
11.70.FC8 Time Limited
图例:

· - Installation completed succesfully

· - Instalation failed

· - Notes

附加说明:

1. 需Informix 11.70 以上版本.

2. Informix 安装测试限于 Debian 7 Wheezy 及 Ubuntu 14.04 LTS+ OS.

3. 虽然Informix在Ubuntu 13.10, Ubuntu 12.04 运行得都不错,但测试建议还是Ubuntu 14.04支持到位。.

4. 假如您使用的是Informix 11.50版本,将不可用。

container building看起来像什么样子呢

johny@ThinkPad:~/Pulpit/projects/github$ sudo docker build -t docker-informix docker-informix


Sending build context to Docker daemon 154.6 kB
Sending build context to Docker daemon
步骤 0 : FROM debian:wheezy
---> f6fab3b798be
步骤 1 : MAINTAINER Tomasz Gaweda
---> Running in 94c33b1c5cf3
---> 327f8ea65618
Removing intermediate container 94c33b1c5cf3
步骤 2 : RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
---> Running in 2bd5145f5f0d
---> d144b00bcda7
Removing intermediate container 2bd5145f5f0d
步骤 3 : ENV http_proxy http://172.17.42.1:8080/
---> Running in 0918c5880aca
---> 4b1e343d3cdf
Removing intermediate container 0918c5880aca
步骤 4 : RUN apt-get update && apt-get -y install wget
---> Running in c062c68e30a6
Get:1 http://security.debian.org wheezy/updates Release.gpg [836 B]
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Get:3 http://http.debian.net wheezy Release.gpg [1655 B]
Get:4 http://http.debian.net wheezy-updates Release.gpg [836 B]
Get:5 http://http.debian.net wheezy Release [168 kB]
Get:6 http://security.debian.org wheezy/updates/main amd64 Packages [287 kB]
...
...
...
Setting up wget (1.13.4-3+deb7u2) ...
###############################################
# IBM Informix Installation script for Debian #
###############################################
>>> OS version: Debian 7.7
>>> Linux Kernel version: Linux 064f0e1ce709 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 GNU/Linux
>>> Upgrading OS and installing dependencies for Informix 12.10
Get:1 http://security.debian.org wheezy/updates Release.gpg [836 B]
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Get:3 http://security.debian.org wheezy/updates/main amd64 Packages [287 kB]
...
...
...
Setting up mksh (40.9.20120630-7) ...
update-alternatives: using /bin/mksh to provide /bin/ksh (ksh) in auto mode
Setting up pdksh (40.9.20120630-7) ...
>>> Create group and user for Informix
>>> Uncompress Informix Archive: iif.12.10.FC4DE.linux-x86_64.tar
>>> Launch silent install ...
...
...
...
>>> Postconfig onconfig ...
>>> Postconfig sqlhost ...
>>> Include tcp support ...
>>> Create informix user environnement
>>> Chown Informix binary directory structure
>>> Create data directory
>>> Deleting unpacked files
>>> Deleting downloaded packages
###############################################
# Installation completed #
###############################################
---> 0882dd952081
Removing intermediate container 101f906ac264
步骤 5 : RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
---> Running in c25b3c8037fd
---> b4039e0f53c3
Removing intermediate container c25b3c8037fd
步骤 6 : VOLUME /home/informix/data
---> Running in b3c5b5e5b3e0
---> 3fb24892267c
Removing intermediate container b3c5b5e5b3e0
步骤 7 : USER informix
---> Running in d08eecd141bb
---> 5cc434bd8078
Removing intermediate container d08eecd141bb
步骤 8 : CMD [ /bin/bash informix_start.sh ; /bin/bash ; /bin/bash informix_stop.sh ]
---> Running in 77efa4c00477
---> 65982dbe23da
Removing intermediate container 77efa4c00477
Successfully built 65982dbe23da

第一次启动时container是什么样子的呢?

johny@ThinkPad:~/$ sudo docker run -it -v "/home/informix/data/" -p 9088:9088 --name informix -e DB_USER=test -e DB_PASS=test -e DB_NAME=test docker-informix


>>> Create data directory structure in /home/informix//data/ (ifx initialization)
>>> Create user "test"...
>>> Starting up the IBM Informix Database (dev) ...
*** Startup of dev SUCCESS ***
>>> Create database "test"...
>>> Grant DBA to database "test" for user "test"...
IBM Informix Dynamic Server Version 12.10.FC4DE Software Serial Number AAA#B000000
#################################################
# Informix container login information:
# database: test
# user: test
# password: test
#################################################

IDS-12.10 dev: exit
>>> Stopping the IBM Informix Database (dev) ...
*** Shutdown of dev SUCCESS ***

停止container

johny@ThinkPad:~/$ docker ps -a


CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c7cc39dd2e7f docker-informix:latest "/bin/sh -c '/bin/ba 5 minutes ago Exited (0) 2 seconds ago informix


johny@ThinkPad:~/$ docker start -ai c7cc39dd2e7f
>>> Starting up the IBM Informix Database (dev) ...
*** Startup of dev SUCCESS ***
IBM Informix Dynamic Server Version 12.10.FC4DE Software Serial Number AAA#B000000
#################################################
# Informix container login information:
# database: test
# user: test
# password: test
#################################################

IDS-12.10 dev: exit
>>> Stopping up the IBM Informix Database (dev) ...
*** Shutdown of dev SUCCESS ***

在这个说明中中缺少什么

· Perl, PHP, Python bindings

· Various tools from IIDUG Software Repository (alternatives for default IBM tools)

· Handling signals in Docker way (https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86#.gc1j6ip0a)

· Configure Informix to be more robust: http://www.cise.ufl.edu/~gv1/techstuff/informix1.txt

Informix工具可能有用但没有默认安装的有:

· https://github.com/rgburnett/informixutils

· https://github.com/fzilic/informix-util

· https://github.com/sqrt529/informix_locks

https://github.com/rgburnett/imigrate/

[{"Product":{"code":"SSGU8G","label":"Informix Servers"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF016","label":"Linux"}],"Version":"11.5;11.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
14 July 2023

UID

swg22004659