docker-images
docker-images copied to clipboard
"No such file or directory" when running database container in Kubernetes configured to use containerd over docker
I am trying to start a pod with an oracle database container in Kubernetes. kubectl logs
returns the following:
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/oracle-db-5bf6b85c74-hrlpd/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 02-APR-2021 11:02:01
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/12.1.0.2/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/oracle-db-5bf6b85c74-hrlpd/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/ORCLCDB.log: No such file or directory
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/spfileORCLCDB.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/dbs/orapwORCLCDB': No such file or directory
mv: cannot stat '/opt/oracle/product/12.1.0.2/dbhome_1/network/admin/tnsnames.ora': No such file or directory
ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID .
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle
/opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
tail: no files remaining
This works just fine when Kubernetes is configured to use docker but there seems to be an issue when configured to use containerd directly. I am sure this has to do with either volume management or permissions similar to what I saw in other issues (#1410, #227 and the cannot create directory error when using volumes in the FAQ), but I am not trying to mount a volume to persist data between containers (dev purpose). I saw that the volume mounting could be omitted if data persistence is not desired:
-v /opt/oracle/oradata The data volume to use for the database. Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! If omitted the database will not be persisted over container recreation.
However I also notice that when using docker, an anonymous volume is created with the container and is removed when the container is removed. Are these oracle images (or the behaviour of omitting the volume mouting) not compatible with other container orchestrators such as Kubernetes?
This is the yaml files I am using:
apiVersion: v1
kind: Namespace
metadata:
name: oracle
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: oracle
name: oracle-db
labels:
app: oracle-db
spec:
replicas: 1
minReadySeconds: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: oracle-db
template:
metadata:
labels:
app: oracle-db
spec:
containers:
- name: database
image: <my-private-repository>/database:12.1.0.2-ee
ports:
- containerPort: 1521
我也遇到了同样的问题
Same issue is happening for me
@cghtom 12.1.0.2 was not tested on Kubernetes. Please try more recent versions like 19c/21c
Oracle Database container images from version 19.3 onwards are tested and supported for Kubernetes. Please use those images. Closing this issue for now.