Db2 Community Edition Docker 再実行時のエラー回避メモ
問題
Db2 Community Edition Docker の再起動時に DBI20187E ファイルオーナーエラーが発生し起動できない。
ERROR: DBI20187E The fencedid file "/database/config/db2inst1/sqllib/adm/fencedid" is invalid because it is not owned by the "root":"db2iadm1". Change the ownership of the fencedid file to be owned by the "root":"db2iadm1" and then rerun the command.
ERROR: An error occurred while configuring the instance "db2inst1".
参考
回避方法
コンテナ起動時に chown root:db2iadm1 /database/config/db2inst1/sqllib/adm/fencedid コマンドを実行してファイルオーナーを変更する。
環境
- Windows 11
- Rancher Desktop
Docker Compose
compose.yaml
services:
db2:
image: icr.io/db2_community/db2:11.5.9.0
container_name: db2-11
privileged: true
restart: always
ports:
- "50000:50000"
env_file:
- ./env_list
volumes:
- ./db2data:/database
command: bash -c "chown root:db2iadm1 /database/config/db2inst1/sqllib/adm/fencedid"
env_list
LICENSE=accept
DB2INSTANCE=db2inst1
DB2INST1_PASSWORD=password
DBNAME=USERDB
BLU=false
ENABLE_ORACLE_COMPATIBILITY=false
UPDATEAVAIL=NO
TO_CREATE_SAMPLEDB=false
REPODB=false
IS_OSXFS=false
PERSISTENT_HOME=true
HADR_ENABLED=false
ETCD_ENDPOINT=
ETCD_USERNAME=
ETCD_PASSWORD=
env_list 参考