我试图在Docker上运行DB2,但是每次重启时它总是初始化示例,我认为不应该是这样,因为它总是需要5分钟以上。
我正在为容器创建一个专用卷,因为由于权限限制无法挂载本地驱动器。我使用的是macOS Ventura 13.0.1。
docker volume create db2
docker run --platform linux/amd64 -h db2server --name db2server --detach --rm --privileged=true -p50000:50000 --env-file env-list.txt -v db2:/database ibmcom/db2:11.5.8.0
使用此ENV
LICENSE=accept
DB2INSTANCE=fapsrv
DB2INST1_PASSWORD=fapsrv
DBNAME=fapsrv
BLU=true
ENABLE_ORACLE_COMPATIBILITY=false
SAMPLEDB=false
HADR_ENABLED=false
ARCHIVE_LOGS=false
它会产生这个日志。看起来还不错。
(*) Previous setup has not been detected. Creating the users...
(*) Creating users ...
(*) Creating instance ...
DB2 installation is being initialized.
Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)
Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end
Task #3 start
Description: Configuring DB2 instances
Estimated time 300 second(s)
Task #3 end
Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end
The execution completed successfully.
For more information see the DB2 installation log at "/tmp/db2icrt.log.237".
DBI1446I The db2icrt command is running.
DBI1070I Program db2icrt completed successfully.
(*) Fixing /etc/services file for DB2 ...
12/07/2022 14:44:42 0 0 SQL1032N No start database manager command was issued.
SQL1032N No start database manager command was issued. SQLSTATE=57019
(*) Cataloging existing databases
ls: cannot access '/database/data/fapsrv/NODE0000': No such file or directory
(*) Applying Db2 license ...
LIC1402I License added successfully.
LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V11.5/license/en_US.iso88591"
(*) Saving the checksum of the current nodelock file ...
(*) Updating DBM CFG parameters ...
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
No Cgroup memory limit detected, instance memory will follow automatic tuning
(*) Enabling analytical workloads for fapsrv ...
(*) Remounting /database with suid...
(*) Nothing appears in the Db2 directory. will skip update/upgrade.
(*) Code level is the same. No update/upgrade needed.
DB2 State : Operable
DB2 has not been started
Starting DB2...
12/07/2022 14:46:40 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
(*) User chose to create fapsrv database
(*) Creating database fapsrv ...
DB20000I The CREATE DATABASE command completed successfully.
DB20000I The ACTIVATE DATABASE command completed successfully.
(*) Log archiving will not be configured as ARCHIVE_LOGS has been set to false.
(*) Applying autoconfiguration for instance ...
Database Connection Information
Database server = DB2/LINUXX8664 11.5.8.0
SQL authorization ID = FAPSRV
Local database alias = FAPSRV
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
DB20000I The SQL command completed successfully.
12/07/2022 14:49:42 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
12/07/2022 14:49:46 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
(*) Skipping TEXT_SEARCH setup for database fapsrv because TEXT_SEARCH is not configured for the instance ...
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
(*) All databases are now active.
(*) Setup has completed.
当我重新发出run命令时,安装程序再次启动,尽管已经有一些文件可用。
(*) Restoring global registry file ...
(*) Previous setup has not been detected. Creating the users...
(*) Creating users ...
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
(*) Preparing the environment before updating the instance ...
(*) Fixing /etc/services file for DB2 ...
(*) Fixing db2nodes file configuration ...
(*) Creating instance ...
DB2 installation is being initialized.
Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)
...
1条答案
按热度按时间eimct9ow1#
使用run确实会重新初始化Db2。在Db2示例上完成操作后,use the Docker stop or pause commands, then the start or unpause commands to resume work。