Hi, sorry for the late response. Yes, it is still working on macos 14.3.1.
I did some research over the internet and I think this might help, but didn't try it myself.
You need to force docker to use linux/amd64 by typing in the same terminal before you type docker-compose "export DOCKER_DEFAULT_PLATFORM=linux/amd64".
Original Message:
Sent: Mon February 05, 2024 01:12 PM
From: Zamir Juma
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Is it working for you post macos 14.3? I'm not using lima/podman, but am using docker desktop w/rosetta enabled. I get similar error to what's described here:
https://stackoverflow.com/questions/77870884/db2start-error-while-loading-shared-libraries-libicudatadb2-so-32-cannot-enab/77905186#77905186
------------------------------
Zamir Juma
Original Message:
Sent: Thu January 04, 2024 06:18 AM
From: Mohamed Asfour
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Hi Jonathan,
I know it is nearly 2 years, I hope this description would help people still facing this issue trying to run db2 community edition container on mac m1.
I'm using podman with lima as rootful along with db2 community edition container
I followed the below link. In my case, it resolved another issue to be running the instance as rootful.
https://kellyrodger.medium.com/db2-on-apple-silicon-e697d3fdc76c
I'm using podman-compose you can rather use podman file.
this my yml compose file:
services:
db2:
image: "icr.io/db2_community/db2:11.5.8.0"
platform: "linux/amd64"
container_name: "db2"
hostname: "db2"
privileged: true
restart: "on-failure"
entrypoint: ["/bin/bash", "-c", ". /root/host/install.sh"]
command: ["/bin/bash", "-c", "echo \"db2 started successfully\""]
ports:
- "22022:22"
- "50000:50000"
environment:
LICENSE: "accept"
DB2INSTANCE: "db2inst1"
DB2INST1_PASSWORD: <specify a password>
IS_OSXFS: "true"
volumes:
- db2-database:/database
- db2-hadr:/hadr
- <path to install.sh>:/root/host
for the install.sh will be as below:
#!/bin/bash
date && \
env && \
if [ "$(cat /database/config/db2inst1/result)" != "success" ]; then \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c '/su - db2inst1 -c '. .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c \"/su - db2inst1 -c \". .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${DB2INSTANCE?} -c '/su - \${DB2INSTANCE?} -c '. .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${DB2INSTANCE?} -c \"/su - \${DB2INSTANCE?} -c \". .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance?} -c '/su - \${instance?} -c '. .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance?} -c \"/su - \${instance?} -c \". .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance_name?} -c '/su - \${instance_name?} -c '. .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - \${instance_name?} -c \"/su - \${instance_name?} -c \". .profile \&\& /g" {} + && \
find /var/db2_setup -type f -not -path '*/\.*' -exec sed -i "s/su - db2inst1 -c \\\\\"/su - db2inst1 -c \\\". .profile \&\& /g" {} + && \
echo \"success\" &> /database/config/db2inst1/result"
fi | \
( \
sleep 30s && \
. /var/db2_setup/lib/setup_db2_instance.sh
)
Regards,
Mohamed Asfour
------------------------------
Mohamed Asfour
Original Message:
Sent: Tue April 26, 2022 07:19 AM
From: Jonathan Herdt
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Sure thing, I did two runs. The way we use DB2 will likely not cover all use cases there are for it so it's possible that we just haven't run into any issues because of that.
First run:
docker run -it --name db2 -e DBNAME=testdb -v ~/:/database -e DB2INST1_PASSWORD=GD1OJfLGG64HV2dtwK -e LICENSE=accept -p 50000:50000 --privileged=true --platform=linux/amd64 ibmcom/db2Unable to find image 'ibmcom/db2:latest' locallylatest: Pulling from ibmcom/db28dfe9326f733: Pull complete 0d875a68bf99: Pull complete 50e8fb20327b: Pull complete a0c05fd037e6: Pull complete 1cd5cf0a05ba: Pull complete 6c97ca72f52c: Pull complete e0c22e12ea4e: Pull complete 06fa0bd3b2ef: Pull complete 01d61e0e2f08: Pull complete 849d15abca93: Pull complete be6ee447107f: Pull complete 408a6e6d33a2: Pull complete a9c177505816: Pull complete Digest: sha256:81d01c71ed0d1ae27ee51ab53133610970b25b60de385a0c1906fe53017f4c96Status: Downloaded newer image for ibmcom/db2:latest(*) Previous setup has not been detected. Creating the users... (*) Creating users ...(*) Creating instance ... DBI1446I The db2icrt command is running.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 startDescription: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 startDescription: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 startDescription: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 startDescription: 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.229".DBI1070I Program db2icrt completed successfully.(*) Fixing /etc/services file for DB2 ... 04/25/2022 15:31:25 0 0 SQL1032N No start database manager command was issued.SQL1032N No start database manager command was issued. SQLSTATE=57019(*) Cataloging existing databasesls: cannot access '/database/data/db2inst1/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(*) 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 : OperableDB2 has not been startedStarting DB2...04/25/2022 15:33:08 0 0 SQL1063N DB2START processing was successful.SQL1063N DB2START processing was successful.(*) User chose to create testdb database(*) Creating database testdb ... DB20000I The CREATE DATABASE command completed successfully.DB20000I The ACTIVATE DATABASE command completed successfully.04/25/2022 15:36:15 0 0 SQL1026N The database manager is already active.SQL1026N The database manager is already active.### Enabling LOGARCHMETH1 Database Connection Information Database server = DB2/LINUXX8664 11.5.7.0 SQL authorization ID = DB2INST1 Local database alias = TESTDBDB20000I 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.### Restarting DB204/25/2022 15:36:27 0 0 SQL1064N DB2STOP processing was successful.SQL1064N DB2STOP processing was successful.04/25/2022 15:36:28 0 0 SQL1042C An unexpected system error occurred.SQL1032N No start database manager command was issued. SQLSTATE=57019### Making backup directory and performing backupSQL1032N No start database manager command was issued.(!) Failed to back up testdb database(*) Applying autoconfiguration for instance ... SQL1032N No start database manager command was issued. SQLSTATE=57019SQL1024N A database connection does not exist. SQLSTATE=0800304/25/2022 15:36:37 0 0 SQL1032N No start database manager command was issued.SQL1032N No start database manager command was issued. SQLSTATE=5701904/25/2022 15:36:38 0 0 SQL1042C An unexpected system error occurred.SQL1032N No start database manager command was issued. SQLSTATE=57019(!) Failed to automatically configure testdb database(*) Skipping TEXT_SEARCH setup for database testdb 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.false2022-04-25-15.36.38.674765+000 I167521E393 LEVEL: WarningPID : 36948 TID : 275370269632 PROC : db2startINSTANCE: db2inst1 NODE : 000HOSTNAME: 9bcdfdc2bdb7FUNCTION: DB2 UDB, base sys utilities, sqleReleaseStStLockFile, probe:16187MESSAGE : Released lock on the file:DATA #1 : String, 50 bytes/database/config/db2inst1/sqllib/ctrl/db2strst.lck
Second run:
> docker run -it --name db2 -e DBNAME=testdb -e DB2INST1_PASSWORD=GD1OJfLGG64HV2dtwK -e LICENSE=accept -p 50000:50000 --privileged=true --platform=linux/amd64 ibmcom/db2(*) Previous setup has not been detected. Creating the users... (*) Creating users ...(*) Creating instance ... DBI1446I The db2icrt command is running.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 startDescription: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 startDescription: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 startDescription: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 startDescription: 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.229".DBI1070I Program db2icrt completed successfully.(*) Fixing /etc/services file for DB2 ... 04/25/2022 15:53:02 0 0 SQL1032N No start database manager command was issued.SQL1032N No start database manager command was issued. SQLSTATE=57019(*) Cataloging existing databasesls: cannot access '/database/data/db2inst1/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(*) 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 : OperableDB2 has not been startedStarting DB2...04/25/2022 15:54:31 0 0 SQL1063N DB2START processing was successful.SQL1063N DB2START processing was successful.(*) User chose to create testdb database(*) Creating database testdb ... DB20000I The CREATE DATABASE command completed successfully.DB20000I The ACTIVATE DATABASE command completed successfully.04/25/2022 15:56:43 0 0 SQL1026N The database manager is already active.SQL1026N The database manager is already active.### Enabling LOGARCHMETH1 Database Connection Information Database server = DB2/LINUXX8664 11.5.7.0 SQL authorization ID = DB2INST1 Local database alias = TESTDBDB20000I 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.### Restarting DB204/25/2022 15:56:54 0 0 SQL1064N DB2STOP processing was successful.SQL1064N DB2STOP processing was successful.04/25/2022 15:56:57 0 0 SQL1063N DB2START processing was successful.SQL1063N DB2START processing was successful.### Making backup directory and performing backupBackup successful. The timestamp for this backup image is : 20220425155701(*) Applying autoconfiguration for instance ... Database Connection Information Database server = DB2/LINUXX8664 11.5.7.0 SQL authorization ID = DB2INST1 Local database alias = TESTDBDB20000I 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 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 SQL command completed successfully.04/25/2022 15:57:20 0 0 SQL1064N DB2STOP processing was successful.SQL1064N DB2STOP processing was successful.04/25/2022 15:57:24 0 0 SQL1063N DB2START processing was successful.SQL1063N DB2START processing was successful.(*) Skipping TEXT_SEARCH setup for database testdb 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. Log File Size: 10242022-04-25-15.57.46.986055+000 E250474E526 LEVEL: EventPID : 38573 TID : 275590932224 PROC : db2sysc 0INSTANCE: db2inst1 NODE : 000 DB : TESTDBAPPHDL : 0-7 APPID: 172.17.0.1.60550.220425155744AUTHID : DB2INST1 HOSTNAME: a39a8d31c347EDUID : 22 EDUNAME: db2agent (idle) 0FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::FreeResourcesOnDBShutdown, probe:16859STOP : DATABASE: TESTDB : DEACTIVATED: NOtail: inotify cannot be used, reverting to polling: Function not implemented
------------------------------
Jonathan Herdt
Original Message:
Sent: Mon April 25, 2022 02:14 PM
From: IRINA DELIDJAKOVA
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Hi @Jonathan Herdt, thanks for looking into this!! We are also going through some of the issues before we can publish a new container with instructions. Using the export env, helps with some issues, but not all. We're still hitting other issues that are being looked at - example some env not persisted. Can you provide the logs from your run? I am surprised you're successful with just that workaround.
------------------------------
IRINA DELIDJAKOVA
Original Message:
Sent: Mon April 25, 2022 12:09 PM
From: Jonathan Herdt
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Was able to find a working solution by running `export DOCKER_DEFAULT_PLATFORM=linux/amd64` before starting my container. This apparently enables a (poorly documented?) x86 compatibility mode in Docker :) You might have to remove your image first before this.
------------------------------
Jonathan Herdt
Original Message:
Sent: Mon January 18, 2021 07:57 PM
From: Jürgen Jost
Subject: DB2 LUW. 11.5.xx - Mac M1 ready
Hello,
Is the DB2 LUW community edition 11.5.xx (may be on docker) M1 ready?
My profile
Juergen Jost
#Db2