Oracle (または) MySQL を IBM Mobile Foundation データベースとして使用する
improve this page | report issueOracle (または) MySQL を IBM Mobile Foundation データベースとして使用する
Mobile Foundation サーバー、Push および Application Center コンポーネントのデータを保管するために、事前構成済みのデータベースが必要です。
DB2 以外のデータベースを使用して Mobile Foundation をセットアップするには、ここにある指示に従います。
デフォルトでは、Mobile Foundation インストーラーは IBM DB2 JDBC ドライバーとともにパッケージ化されています。 Oracle および MySQL の場合、JDBC ドライバー (MySQL の場合、Connector/J JDBC ドライバーを使用し、Oracle の場合、Oracle シン JDBC ドライバーを使用します) が永続ボリューム内に配置されていることを確認してください。
注:
Oracle データベースの場合:
- カスタム・リソース・ファイル (
CR.yaml
) の db セクションの下にあるプロパティー name に対して Oracle サービス名を使用します。- Oracle データベース・ユーザーが大文字で作成され、データベース秘密の作成時に同じものが使用されていることを確認してください。
-
JDBC ドライバーを NFS マウント・ボリュームに配置します。 例: /nfs/share/dbdrivers
-
NFS サーバーの正しい詳細および JDBC ドライバーが保管されている場所のパスを指定することで、永続ボリューム (PV) および永続ボリューム要求 (PVC) を作成します。 サンプル yaml を以下に示します。
# サンプル PersistentVolume.yaml cat <<EOF | kubectl apply -f - apiVersion: v1 kind: PersistentVolume metadata: labels: name: mfppvdbdrivers name: mfppvdbdrivers spec: accessModes: - ReadWriteMany capacity: storage: 20Gi nfs: path: <nfs_path> server: <nfs_server> EOF
# サンプル PersistentVolumeClaim.yaml cat <<EOF | kubectl apply -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mfppvc namespace: projectname-or-namespace spec: accessModes: - ReadWriteMany resources: requests: storage: 20Gi selector: matchLabels: name: mfppvdbdrivers volumeName: mfppvdbdrivers status: accessModes: - ReadWriteMany capacity: storage: 20Gi EOF
注: 上記の yaml に正しい projectname-or-namespace を追加したことを確認します。
[オプション] 特権 (admin) を使用して Mobile Foundation データベース操作を処理する
個別のデータベース管理秘密を使用して、データベースの初期化タスクを実行できます。これにより、必要な Mobile Foundation スキーマおよび表がデータベースに作成されます (まだ存在しない場合)。 データベース管理秘密を使用して、データベース・インスタンスでの DDL 操作を制御できます。
MFP サーバー DB 管理秘密
および MFP Appcenter DB 管理秘密
の詳細が指定されていない場合、デフォルトのデータベース秘密名
を使用してデータベース初期化タスクが実行されます。
Mobile Foundation サーバー用の MFP サーバー DB 管理秘密
を作成するには、以下のコード・スニペットを実行します。
# Create MFP Server Admin DB secret for Mobile Foundation server component
cat <<EOF | kubectl apply -f -
apiVersion: v1
data:
MFPF_ADMIN_DB_ADMIN_USERNAME: encoded_uname
MFPF_ADMIN_DB_ADMIN_PASSWORD: encoded_password
MFPF_RUNTIME_DB_ADMIN_USERNAME: encoded_uname
MFPF_RUNTIME_DB_ADMIN_PASSWORD: encoded_password
MFPF_PUSH_DB_ADMIN_USERNAME: encoded_uname
MFPF_PUSH_DB_ADMIN_PASSWORD: encoded_password
kind: Secret
metadata:
name: mfpserver-dbadminsecret
type: Opaque
EOF
Appcenter 用の MFP Appcenter DB 管理秘密
を作成するには、以下のコード・スニペットを実行します。
# Create Appcenter Admin DB secret for Mobile Foundation Appcenter
cat <<EOF | kubectl apply -f -
apiVersion: v1
data:
MFPF_APPCNTR_DB_ADMIN_USERNAME: encoded_uname
MFPF_APPCNTR_DB_ADMIN_PASSWORD: encoded_password
kind: Secret
metadata:
name: appcenter-dbadminsecret
type: Opaque
EOF
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.