Create Replicated TimesTen Classic Databases
- Create the YAML manifest file for the TimesTenClassic object.
vi repsample.yaml apiVersion: timesten.oracle.com/v4 kind: TimesTenClassic metadata: name: repsample spec: ttspec: storageClassName: oci-bv storageSize: 10Gi image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 imagePullSecret: sekret dbConfigMap: - repsampleNote the following:-
The
storageClassNameisoci-bv. Replaceoci-bvwith the name of your storage class. -
The
storageSizeis10Gi. Replace10Giwith the amount of storage that needs to be requested for each Pod to hold TimesTen. -
The
imageiscontainer-registry.oracle.com/timesten/timesten:22.1.1.34.0. Replaceimagewith the name and location of your TimesTen container image. -
The
imagePullSecretissekret. Replacesekretwith the image pull secret that Kubernetes needs to use to fetch the TimesTen container image. - The
dbConfigMapspecifies therepsampleConfigMap created in About the Examples.
-
- Deploy the TimesTenClassic object into your namespace.
kubectl create -f repsample.yamlThe output is the following:timestenclassic.timesten.oracle.com/repsample created - Monitor deployment.
- Check status of object.
kubectl get ttc repsampleThe output is similar to the following:
NAME STATE ACTIVE AGE repsample Initializing None 9sThe provisioning starts, but is not completed as indicated by the
Initializingstate. - Wait a few minutes. Then, check status again.
kubectl get ttc repsampleThe output is similar to the following:
NAME STATE ACTIVE AGE repsample Normal repsample-0 2m27sThe provisioning process completes. The active and standby databases are up and running and operational. The TimesTen Operator transitions the
repsampleobject to theNormalstate.
- Check status of object.
- (Optional): Review the state transitions.
kubectl get eventsThe output is similar to the following:
LAST SEEN TYPE REASON OBJECT MESSAGE ... 4m46s Normal Create timestenclassic/repsample Service repsample created 4m46s Warning Warning timestenclassic/repsample Database CPU limit/request not specified 4m46s Normal Create timestenclassic/repsample StatefulSet repsample created 4m46s Warning Create timestenclassic/repsample PodMonitor repsample created 3m46s Normal Info timestenclassic/repsample Pod repsample-0 Agent Up 3m46s Normal Info timestenclassic/repsample Pod repsample-0 Release 22.1.1.34.0 3m46s Normal Info timestenclassic/repsample Pod repsample-1 Agent Up 3m46s Normal Info timestenclassic/repsample Pod repsample-1 Release 22.1.1.34.0 3m46s Normal Info timestenclassic/repsample Pod repsample-0 Daemon Up 3m45s Normal Info timestenclassic/repsample Pod repsample-1 Daemon Up 3m30s Normal Info timestenclassic/repsample Pod repsample-0 Database Loaded 3m30s Normal Info timestenclassic/repsample Pod repsample-0 Database Updatable 3m29s Normal Info timestenclassic/repsample Pod repsample-0 RepAgent Running 3m29s Normal Info timestenclassic/repsample Pod repsample-0 RepScheme Exists 3m29s Normal StateChange timestenclassic/repsample Pod repsample-0 RepState ACTIVE 2m38s Normal Info timestenclassic/repsample Pod repsample-1 Database Loaded 2m38s Normal Info timestenclassic/repsample Pod repsample-1 RepScheme Exists 2m38s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState IDLE 2m37s Normal Info timestenclassic/repsample Pod repsample-1 Database Loaded 2m37s Normal Info timestenclassic/repsample Pod repsample-1 RepScheme Exists 2m37s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState IDLE 2m32s Normal Info timestenclassic/repsample Pod repsample-1 RepAgent Running 2m32s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState STANDBY 2m31s Normal StateChange timestenclassic/repsample TimesTenClassic was Initializing, now Normal 2m26s Normal StateChange timestenclassic/repsample Pod repsample-0 is Ready 2m26s Normal StateChange timestenclassic/repsample Pod repsample-0 is Active Ready 2m26s Normal StateChange timestenclassic/repsample Pod repsample-1 is ReadyDuring the provisioning process, the TimesTenClassic object transitions from the
Initializingto theNormalstate. - Verify the existence of the underlying objects.
1. StatefulSet:
kubectl get statefulset repsampleThe output is similar to the following:
NAME READY AGE repsample 1/2 7m22s2. Service:
kubectl get service repsampleThe output is similar to the following:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE repsample ClusterIP None <none> 6625/TCP,8888/TCP 8m2s3. Pods:kubectl get podsThe output is similar to the following:NAME READY STATUS RESTARTS AGE repsample-0 3/3 Running 0 8m31s repsample-1 2/3 Running 0 8m31s ...4. PVCs:
kubectl get pvcThe output is similar to the following:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE tt-persistent-repsample-0 Bound csi-f36b2402-9745-46bd-a023-811839ab518e 250Gi RWO oci-bv 8m59s tt-persistent-repsample-1 Bound csi-0a0cfd59-b2bf-48b7-bdef-6ee03794891b 250Gi RWO oci-bv 8m59s - Connect to the active database.
- From your development host, establish a shell in the Pod.
kubectl exec -it repsample-0 -c tt -- /bin/bash - Connect to the active database. Insert a row in a table.
[timesten@repsample-0 ~]$ ttIsql repsample Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. Type ? or "help" for help, type "exit" to quit ttIsql. connect "DSN=repsample"; Connection successful: DSN=repsample;UID=timesten;DataStore=/tt/home/timesten/datastore/repsample;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;AutoCreate=0;PermSize=200;DDLReplicationLevel=3;ForceDisconnectEnabled=1; (Default setting AutoCommit=1) Command> select * from adminuser.emp; 0 rows found. Command> describe adminuser.emp; Table ADMINUSER.EMP: Columns: *ID NUMBER NOT NULL NAME CHAR (32) PRIMARY KEY (ID) RANGE INDEX 1 table found. (primary key columns are indicated with *) Command> insert into adminuser.emp values (1,'test'); 1 row inserted. Command> commit; Command> select * from adminuser.emp; < 1, test > 1 row found. - Exit from
ttIsqland from the shell.Command> exit Disconnecting... Done. [timesten@repsample-0 ~]$ exit exit
- From your development host, establish a shell in the Pod.