从Docker启动DB2 11.5时无法访问NODE0000

y1aodyip  于 2023-04-06  发布在  DB2
关注(0)|答案(1)|浏览(198)

我试图在Mac(M1)上启动DB2 docker镜像进行测试,但遇到了权限问题。

03/31/2023 11:55:21     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/db2inst1/NODE0000: No such file or directory

这是复制它的命令:

docker run --platform linux/x86_64/v8 -e LICENSE=accept --rm -it ibmcom/db2:11.5.0.0a bash

如何成功启动映像?

pcww981p

pcww981p1#

解决方案是在特权模式下运行该命令。此外,在M1(ARM)上运行需要在仿真模式下运行容器。下面是一个将完全设置测试容器的命令:

docker run --platform linux/x86_64/v8 --privileged=true --user 0 \
-e "LICENSE=accept" \
-e "DB2INSTANCE=db2inst1" \
-e "DB2INST1_PASSWORD=admin" \
-e "DBNAME=mydb2" \
-e "TO_CREATE_SAMPLEDB=true" \
-e "ENABLE_ORACLE_COMPATIBILITY=false" \
-e "UPDATEAVAIL=NO" \
-e "IS_OSXFS=false" \
-e "REPODB=false" \
-e "PERSISTENT_HOME=true" ibmcom/db2:11.5.0.0a bash

如果不在ARM上运行,只需省略平台标志,如下所示:

docker run --privileged=true --user 0 \
-e "LICENSE=accept" \
-e "DB2INSTANCE=db2inst1" \
-e "DB2INST1_PASSWORD=admin" \
-e "DBNAME=mydb2" \
-e "TO_CREATE_SAMPLEDB=true" \
-e "ENABLE_ORACLE_COMPATIBILITY=false" \
-e "UPDATEAVAIL=NO" \
-e "IS_OSXFS=false" \
-e "REPODB=false" \
-e "PERSISTENT_HOME=true" ibmcom/db2:11.5.0.0a bash

相关问题