在k8s中使用Oracle Storage Server模拟ASM设备
用软件模拟 Oracle RAC 的 ASM 设备。
Table of Contents
Steps to make the storage server pod and provision it as a PV (persistent volume)
1. Get the Dockerfile of the storage server
2.Build docker image oracle/rac-storage-server
3. Make sure SELinux is disabled for your k8s node
4. Install NFS server binary on your k8s node
5. Create the pod that provides the storage server
6. Get the IP of the storage server pod
Introduction
Oracle RAC database needs ASM (Automatic Storage Management) storage device, but we don't usually have it at hand. For test or POC purpose, we can use Oralce storage server to simulate it. This document describes the steps of creating storage server in a kubernetes (k8s) cluster, based on the official docker image.
ASM storage in Oracle RAC uses a private network interface (192.168), we assume that your k8s cluster has enabled multiple network interfaces support.
Steps to make the storage server pod and provision it as a PV (persistent volume)
We are going to start a pod to provide the NFS service and provision the storage as a PV.
1. Get the Dockerfile of the storage server
|
2.Build docker image oracle/rac-storage-server
|
3. Make sure SELinux is disabled for your k8s node
|
(The value returned should be "disabled", otherwise change it so)
4. Install NFS server binary on your k8s node
|
5. Create the pod that provides the storage server
Here we basically turn the "docker run ..." command in OracleRACStorageServer/README.md to a pod spec:
racnode-storage.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
Change the @http(s)_proxy@ to proper value and:
|
Note 1:
We are using multus to provide multiple/customized network interfaces. The pod annotation "k8s.v1.cni.cncf.io/networks: macvlan-conf" indicates that this pod would have two network interfaces, i.e. one of flannel (default) and one of macvlan.
Note 2:
It takes 4~10 minutes for the racnode-storage pod to be ready, use the following command to track the log:
bash-4.2$ kubectl logs -f racnode-storageThe final output should be someting like:
####################################################
NFS Server is up and running
Create NFS volume for /oradata/
####################################################
6. Get the IP of the storage server pod
Because the secondary network interface (macvlan) is unavailable from kubelet, we will have to use the flannel IP (we may take the flannel interface as private):
|
We'll use it in next step.
7. Create storage pv and pvc
Now create a file racnode-pv.yaml, set spec.nfs.server to the IP we just got:
racnode-pv.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
As you can see, this is turning the "docker volume create ..." command in OracleRACStorageServer/README.md to a pv and a pvc.
|
Now our ASM storage is ready to be consumed.
更多推荐
所有评论(0)