Oracle Autonomous Database Free Container Image Documentation
以下のMacbook Proで作業を行なっています。今となっては世代が古いM1チップです。Mシリーズの世代で動作は変わらないとは思いますが、QEMUによるIntel CPUのエミュレーションで動作させるため、CPUの世代の違いで動作が変わることが無いとは言えません。
FAQのHow can I install colima and docker on machines with M1/M2 chips ?に記載されている手順に従い、docker、docker-compose、colima、qemuをインストールします。
brew install docker
% docker --version
Docker version 26.1.2, build 211e74b240
% docker-compose --version
Docker Compose version 2.27.0
% colima --version
colima version 0.6.8
% qemu-system-x86_64 -version
QEMU emulator version 9.0.0
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
%
% colima start --cpu 4 --memory 10 --arch x86_64
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0001] starting ... context=vm
INFO[0048] provisioning ... context=docker
INFO[0049] starting ... context=docker
INFO[0055] done
%
docker pull container-registry.oracle.com/database/adb-free:latest-23ai
% docker pull container-registry.oracle.com/database/adb-free:latest-23ai
latest-23ai: Pulling from database/adb-free
00ef0c1abdfe: Pull complete
4fb9e1cce3a6: Pull complete
40356c1517a2: Pull complete
Digest: sha256:6d59345fee044ceaccfc7db346f71a4013f20190b799ea28acdd7755589b8740
Status: Downloaded newer image for container-registry.oracle.com/database/adb-free:latest-23ai
container-registry.oracle.com/database/adb-free:latest-23ai
%
コンテナadb-freeを作成します。作成するAutonomous Datababaseの管理者パスワードを環境変数MYPASSに設定します。ワークロード・タイプにATPを指定します。
% export MYPASS=********
% docker run -d \
-p 1521:1522 \
-p 1522:1522 \
-p 8443:8443 \
-p 27017:27017 \
-e WORKLOAD_TYPE=ATP \
-e WALLET_PASSWORD=$MYPASS \
-e ADMIN_PASSWORD=$MYPASS \
--cap-add SYS_ADMIN \
--device /dev/fuse \
--name adb-free \
container-registry.oracle.com/database/adb-free:latest-23ai
75f48a4a470bc273c9fcf4d000b129b88d5b82dbfa258b658db1404f68b07524
%
% docker logs -f adb-free
Archive: /u01/POD1.zip
creating: /u01/app/oracle/oradata/
creating: /u01/app/oracle/oradata/POD1/
creating: /u01/app/oracle/oradata/POD1/17204CBA6183008CE063C4D75E6492EC/
creating: /u01/app/oracle/oradata/POD1/17204CBA6183008CE063C4D75E6492EC/datafile/
creating: /u01/app/oracle/oradata/POD1/175E8D561B6D4CDEE0636402000A1C40/
creating: /u01/app/oracle/oradata/POD1/175E8D561B6D4CDEE0636402000A1C40/datafile/
inflating: /u01/app/oracle/oradata/POD1/redo01.log
inflating: /u01/app/oracle/oradata/POD1/redo02.log
creating: /u01/app/oracle/oradata/POD1/datafile/
inflating: /u01/app/oracle/oradata/POD1/datafile/o1_mf_temp_m33n3tv9_.tmp
inflating: /u01/app/oracle/oradata/POD1/datafile/o1_mf_system_m33lvr7m_.dbf
inflating: /u01/app/oracle/oradata/POD1/datafile/o1_mf_undotbs1_m33n3t3g_.dbf
inflating: /u01/app/oracle/oradata/POD1/datafile/o1_mf_sysaux_m33lz7xh_.dbf
inflating: /u01/app/oracle/oradata/POD1/datafile/o1_mf_data_m33m2s61_.dbf
creating: /u01/app/oracle/oradata/POD1/175E8F7D3A3D4D65E0636402000AA841/
creating: /u01/app/oracle/oradata/POD1/175E8F7D3A3D4D65E0636402000AA841/datafile/
creating: /u01/app/oracle/oradata/POD1/onlinelog/
creating: /u01/app/oracle/oradata/POD1/171F1841E82CF4B3E063C4D75E643770/
creating: /u01/app/oracle/oradata/POD1/171F1841E82CF4B3E063C4D75E643770/datafile/
creating: /u01/app/oracle/oradata/POD1/175E81D3E11F4989E0636402000AD075/
creating: /u01/app/oracle/oradata/POD1/175E81D3E11F4989E0636402000AD075/datafile/
creating: /u01/app/oracle/oradata/POD1/controlfile/
inflating: /u01/app/oracle/oradata/POD1/controlfile/o1_mf_m33m65kk_.ctl
TIME ELAPSED Unzipping /u01/POD1.zip: 1 minutes and 5 seconds elapsed
User input JSON not found
MY ADB WORKLOAD_TYPE is ATP
MY ADB CUSTOM NAME is MYATP
BUILDER: Configuring TCPS
BUILDER: Cleanup /u01/app/oracle/wallets/tls_wallet
BUILDER: Creating auto login wallet for server
Oracle PKI Tool Release 23.0.0.0.0 - Production
# /tmp/hs_err_pid767.log
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
/usr/local/bin/ords: line 222: 767 Aborted ${JAVA} "${APP_VM_OPTS[@]}" ${ORDS_DEBUG} -jar "${ORDS_HOME}"/${ORDS_WAR} ${ORDS_VERBOSE} "$@"
% docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
%
% docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b25947e90852 container-registry.oracle.com/database/adb-free:latest "/bin/bash -c /u01/s…" 12 minutes ago Exited (134) 4 minutes ago adb-free
%
コンテナadb-freeを起動します。
docker start adb-free
% docker start adb-free
adb-free
%
また、以下のような状況でエラーが発生し、構成スクリプトが中断したこともありました。
ORDS: Release 23.4 Production on Tue Mar 26 05:41:46 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/u01/ords/
Oracle REST Data Services - Non-Interactive Customer Managed ORDS for Autonomous Database
Error the Autonomous database connection failed for user: ADMIN TNS service name: MY_ATP_low
java.sql.SQLRecoverableException: IO Error: Connection reset by peer, connect lapse 1508 ms., Authentication lapse 0 ms.
この場合は、コンテナを削除して作り直すことで対応できました。(docker rmとdocker runの再実行)。原因は不明ですが、Colimaの環境を作成した直後にadb-freeのコンテナを作成すると、コンテナの再作成が必要なエラーが発生することが多い気がします。
22024-05-13T03:10:30.181Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-05-13T03:10:30.183Z WARNING *** jdbc.InitialLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-05-13T03:11:06.303Z INFO
Mapped local pools from /u01/ords/databases:
/ords/ => default => VALID
2024-05-13T03:11:07.121Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 24.1.0.r1080942
Oracle REST Data Services server info: jetty/10.0.20
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM 11.0.21+9-LTS-193