Docker上的DB2总是重新初始化示例,

at0kjp5o  于 2022-12-11  发布在  Docker
关注(0)|答案(1)|浏览(195)

我试图在Docker上运行DB2,但是每次重启时它总是初始化示例,我认为不应该是这样,因为它总是需要5分钟以上。
我正在为容器创建一个专用卷,因为由于权限限制无法挂载本地驱动器。我使用的是macOS Ventura 13.0.1。

  1. docker volume create db2
  2. 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

  1. LICENSE=accept
  2. DB2INSTANCE=fapsrv
  3. DB2INST1_PASSWORD=fapsrv
  4. DBNAME=fapsrv
  5. BLU=true
  6. ENABLE_ORACLE_COMPATIBILITY=false
  7. SAMPLEDB=false
  8. HADR_ENABLED=false
  9. ARCHIVE_LOGS=false

它会产生这个日志。看起来还不错。

  1. (*) Previous setup has not been detected. Creating the users...
  2. (*) Creating users ...
  3. (*) Creating instance ...
  4. DB2 installation is being initialized.
  5. Total number of tasks to be performed: 4
  6. Total estimated time for all tasks to be performed: 309 second(s)
  7. Task #1 start
  8. Description: Setting default global profile registry variables
  9. Estimated time 1 second(s)
  10. Task #1 end
  11. Task #2 start
  12. Description: Initializing instance list
  13. Estimated time 5 second(s)
  14. Task #2 end
  15. Task #3 start
  16. Description: Configuring DB2 instances
  17. Estimated time 300 second(s)
  18. Task #3 end
  19. Task #4 start
  20. Description: Updating global profile registry
  21. Estimated time 3 second(s)
  22. Task #4 end
  23. The execution completed successfully.
  24. For more information see the DB2 installation log at "/tmp/db2icrt.log.237".
  25. DBI1446I The db2icrt command is running.
  26. DBI1070I Program db2icrt completed successfully.
  27. (*) Fixing /etc/services file for DB2 ...
  28. 12/07/2022 14:44:42 0 0 SQL1032N No start database manager command was issued.
  29. SQL1032N No start database manager command was issued. SQLSTATE=57019
  30. (*) Cataloging existing databases
  31. ls: cannot access '/database/data/fapsrv/NODE0000': No such file or directory
  32. (*) Applying Db2 license ...
  33. LIC1402I License added successfully.
  34. 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"
  35. (*) Saving the checksum of the current nodelock file ...
  36. (*) Updating DBM CFG parameters ...
  37. DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
  38. successfully.
  39. DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
  40. successfully.
  41. DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
  42. successfully.
  43. No Cgroup memory limit detected, instance memory will follow automatic tuning
  44. (*) Enabling analytical workloads for fapsrv ...
  45. (*) Remounting /database with suid...
  46. (*) Nothing appears in the Db2 directory. will skip update/upgrade.
  47. (*) Code level is the same. No update/upgrade needed.
  48. DB2 State : Operable
  49. DB2 has not been started
  50. Starting DB2...
  51. 12/07/2022 14:46:40 0 0 SQL1063N DB2START processing was successful.
  52. SQL1063N DB2START processing was successful.
  53. (*) User chose to create fapsrv database
  54. (*) Creating database fapsrv ...
  55. DB20000I The CREATE DATABASE command completed successfully.
  56. DB20000I The ACTIVATE DATABASE command completed successfully.
  57. (*) Log archiving will not be configured as ARCHIVE_LOGS has been set to false.
  58. (*) Applying autoconfiguration for instance ...
  59. Database Connection Information
  60. Database server = DB2/LINUXX8664 11.5.8.0
  61. SQL authorization ID = FAPSRV
  62. Local database alias = FAPSRV
  63. DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
  64. SQL1363W One or more of the parameters submitted for immediate modification
  65. were not changed dynamically. For these configuration parameters, the database
  66. must be shutdown and reactivated before the configuration parameter changes
  67. become effective.
  68. DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
  69. DB20000I The SQL command completed successfully.
  70. 12/07/2022 14:49:42 0 0 SQL1064N DB2STOP processing was successful.
  71. SQL1064N DB2STOP processing was successful.
  72. 12/07/2022 14:49:46 0 0 SQL1063N DB2START processing was successful.
  73. SQL1063N DB2START processing was successful.
  74. (*) Skipping TEXT_SEARCH setup for database fapsrv because TEXT_SEARCH is not configured for the instance ...
  75. ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
  76. (*) All databases are now active.
  77. (*) Setup has completed.

当我重新发出run命令时,安装程序再次启动,尽管已经有一些文件可用。

  1. (*) Restoring global registry file ...
  2. (*) Previous setup has not been detected. Creating the users...
  3. (*) Creating users ...
  4. useradd: warning: the home directory already exists.
  5. Not copying any file from skel directory into it.
  6. useradd: warning: the home directory already exists.
  7. Not copying any file from skel directory into it.
  8. (*) Preparing the environment before updating the instance ...
  9. (*) Fixing /etc/services file for DB2 ...
  10. (*) Fixing db2nodes file configuration ...
  11. (*) Creating instance ...
  12. DB2 installation is being initialized.
  13. Total number of tasks to be performed: 4
  14. Total estimated time for all tasks to be performed: 309 second(s)
  15. ...

相关问题