DB2 LUW. 11.5.xx - Mac M1 ready
DB2 LUW. 11.5.xx - Mac M1 ready
![Jürgen Jost](https://higherlogicdownload.s3.amazonaws.com/IMWUC/Images/ProfileImageDefault/T6FlabNTze4G0FTAa1dq_EvqA7zSoTduJ6W40ZlyZ_user_icon_lg_200_50.jpg)
Jürgen JostMon January 18, 2021 07:58 PM
-
maybe there is some testing of LUW 11.5.xx on Rosetta
from macrumors:
Macs powered by Apple silicon, such as the M1 MacBook Pro, can run both iOS apps and Mac apps, but they can also run x86-64 software that's been built to work on Intel architecture, thanks to something called Rosetta 2.
------------------------------
Jürgen Jost
DB2 DBA (LUW / zOS)
------------------------------
-
It doesn't look good from everything I can see. The official Docker image lists itself as not compatible with arm64, and when you try via Rosetta/x86 emulation, you run into problems as described here.
------------------------------
Jonathan Herdt
------------------------------
-
Would love to know the same. Having changed computers recently to an M1 and realizing that none of the IBM DB2 stuff works was disappointing.
I am talking about both the Docker image (https://hub.docker.com/r/ibmcom/db2), as well as the CLI driver (https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/).
For us, the Docker image does not seem to know the db2 command, even when run in x86 mode:/bin/bash: db2stop: command not found
As it stands, this makes development with M1 very hard because we now have to find ways around these hurdles.
------------------------------
Jonathan Herdt
------------------------------
-
You can try the following to make it run in x86 emulated mode:
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/db2
As stated above, this will not work as it will not be able to find db2 and db2stop. For me, I get the following output:
(*) 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 start Description: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 start Description: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 start Description: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 start Description: 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.195". DBI1070I Program db2icrt completed successfully. (*) Fixing /etc/services file for DB2 ... /bin/bash: db2stop: command not found
And then a lot of error output follows.
------------------------------
Jonathan Herdt
------------------------------
-
I would very much like to hear a response from an IBM employee on this. M1 has been around for a year and is now the default architecture for new Macs. More and more people are getting M1 Macs so this issue will not go away but rather become more pressing over time.
------------------------------
Jonathan Herdt
------------------------------
-
@Jonathan Herdt I'm aware of the issue and will investigate. Will provide a response to this thread once I know more.
------------------------------
IRINA DELIDJAKOVA
------------------------------
-
Hi All, this will not be an easy fix and we will need to support Db2 server on arm64 architectures before the container can support it as well. We are planning this for a future Db2 version - no particular date in plan yet as it is currently being evaluated.
------------------------------
IRINA DELIDJAKOVA
------------------------------
-
@IRINA DELIDJAKOVA Hey Irina, thanks a lot for being open about this and very good to hear that you're working on it. I understand that this will be challenging and that it can take time. Any chance you could work on making the x86 emulation work in the meantime, in case that's easier/quicker (see my message above for how to start Docker like this)? 🙏
------------------------------
Jonathan Herdt
------------------------------
-
Hello @IRINA DELIDJAKOVA, are there any updates about DB2 on Docker?
------------------------------
Jonathan Herdt
------------------------------
-
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
------------------------------
-
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
------------------------------
-
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/db2 Unable to find image 'ibmcom/db2:latest' locally latest: Pulling from ibmcom/db2 8dfe9326f733: 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:81d01c71ed0d1ae27ee51ab53133610970b25b60de385a0c1906fe53017f4c96 Status: 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 start Description: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 start Description: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 start Description: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 start Description: 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 databases ls: 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 : Operable DB2 has not been started Starting 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 = TESTDB 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. ### Restarting DB2 04/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 backup SQL1032N 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=57019 SQL1024N A database connection does not exist. SQLSTATE=08003 04/25/2022 15:36:37 0 0 SQL1032N No start database manager command was issued. SQL1032N No start database manager command was issued. SQLSTATE=57019 04/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. false 2022-04-25-15.36.38.674765+000 I167521E393 LEVEL: Warning PID : 36948 TID : 275370269632 PROC : db2start INSTANCE: db2inst1 NODE : 000 HOSTNAME: 9bcdfdc2bdb7 FUNCTION: DB2 UDB, base sys utilities, sqleReleaseStStLockFile, probe:16187 MESSAGE : 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 start Description: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 start Description: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 start Description: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 start Description: 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 databases ls: 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 : Operable DB2 has not been started Starting 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 = TESTDB 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. ### Restarting DB2 04/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 backup Backup 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 = TESTDB 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 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: 1024 2022-04-25-15.57.46.986055+000 E250474E526 LEVEL: Event PID : 38573 TID : 275590932224 PROC : db2sysc 0 INSTANCE: db2inst1 NODE : 000 DB : TESTDB APPHDL : 0-7 APPID: 172.17.0.1.60550.220425155744 AUTHID : DB2INST1 HOSTNAME: a39a8d31c347 EDUID : 22 EDUNAME: db2agent (idle) 0 FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::FreeResourcesOnDBShutdown, probe:16859 STOP : DATABASE: TESTDB : DEACTIVATED: NO tail: inotify cannot be used, reverting to polling: Function not implemented
------------------------------
Jonathan Herdt
------------------------------
-
Hi Jonathan, thanks for these posts.
Tried running the below command and getting error. Could you please suggest how to fix this issue. We are using Mac M1 chip (OS - Moneterey)
podman run -h db2server --name db2server --detach --privileged=true -p 50000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -v /var/home/core/.spmdb:/database --platform=linux/amd64 ibmcom/db2
35a107a7edf3de15720c01dd0182a946ef596c02435c94234dde5a7ff131b605
<user>@<home> ~ %ERRO[0332] accept tcp [::]:50000: use of closed network connection
Thank you.
Mohanavalli
------------------------------
Mohanavalli Ilangovan
------------------------------
-
Hi Mohanavalli, the error you're posting suggests a problem with your port configuration (either on your host machine or in your Docker container) but that's as far as I can get here since I don't have much experience with podman. I had tried out podman as well for db2 but ran into other issues. If you can't or don't want to use Docker, I was successful with
colima
: Installcolima
as described on their GitHub page and then start it in emulated mode likecolima start --arch x86_64
. Now you will be able to use youribmcom/db2
image the way you're used to.
Remember that if this doesn't work, you might have to delete your locally stored image, iedocker image rm your_img
or similar.
------------------------------
Jonathan Herdt
------------------------------
------------------------------------------------------------------------------------------
如果你觉得文章有用,欢迎打赏