# Installing MariaDB Galera on IBM Cloud

Get MariaDB Galera on IBM Cloud

You should have an IBM Cloud account; otherwise, you can [register here](https://cloud.ibm.com/registration).\
At the end of the tutorial, you will have a cluster with MariaDB up and running. IBM Cloud uses Bitnami charts to deploy MariaDB Galera with Helm

1. We will provision a new Kubernetes Cluster for you if, you already have one, skip to step **2**
2. We will deploy the IBM Cloud Block Storage plug-in; if you already have it, skip to step **3**
3. MariaDB Galera deployment

## Step 1: Provision Kubernetes Cluster

* Click the Catalog button on the top
* Select Service from the catalog
* Search for Kubernetes Service and click on it

![kubernetes-select](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FKURgOponaC6QQLJVwjL6%2F2.PNG?alt=media\&token=bb7fe7ae-01e9-478c-910b-ae27d71e6126)

* You are now at the Kubernetes deployment page; you need to specify some details about the cluster
* Choose a standard or free plan; the free plan only has one worker node and no subnet. to provision a standard cluster, you will need to upgrade account to Pay-As-You-Go
* To upgrade to a Pay-As-You-Go account, complete the following steps:
* In the console, go to Manage > Account.
* Select Account settings, and click Add credit card.
* Enter your payment information, click Next, and submit your information
* Choose classic or VPC, read the [docs](https://cloud.ibm.com/docs/containers?topic=containers-infrastructure_providers), and choose the most suitable type for yourself

![infra-select](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2Fivd47QO6W7gNmhXQdzer%2F3.PNG?alt=media\&token=6b23a49e-221d-45e9-b8d4-548bd7c7b10b)

* Now choose your location settings; for more information, please visit [Locations](https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#zones)
* Choose Geography (continent)

![location-geo](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FYnY6s5HcdPzajTvZoknH%2F4.PNG?alt=media\&token=b8a39cf6-a54e-43e0-93b2-6de9f9f21542)

* Choose Single or Multizone. In single zone, your data is only kept in one datacenter; on the other hand, with Multizone it is distributed to multiple zones, thus safer in an unforeseen zone failure

![location-avail](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FnORUHvUO5juvnfKnpoUh%2F5.PNG?alt=media\&token=81d01b0c-7914-4b85-914d-0f1469b16335)

* Choose a Worker Zone if using Single zones or Metro if Multizone

![location-worker](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FhGkxxbZIZaLTYbHeqJpM%2F6.PNG?alt=media\&token=050311d4-1011-4a11-a286-ea4490087b39)

* If you wish to use Multizone please set up your account with [VRF](https://cloud.ibm.com/docs/dl?topic=dl-overview-of-virtual-routing-and-forwarding-vrf-on-ibm-cloud) or [enable Vlan spanning](https://cloud.ibm.com/docs/vlans?topic=vlans-vlan-spanning#vlan-spanning)
* If at your current location selection, there is no available Virtual LAN, a new Vlan will be created for you
* Choose a Worker node setup or use the preselected one, set Worker node amount per zone

![worker-pool](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2Fo9i5urKsUETCW39rfcjE%2F7.PNG?alt=media\&token=10a39de8-b002-4e72-8a36-fd20eb4edce6)

* Choose Master Service Endpoint, In VRF-enabled accounts, you can choose private-only to make your master accessible on the private network or via VPN tunnel. Choose public-only to make your master publicly accessible. When you have a VRF-enabled account, your cluster is set up by default to use both private and public endpoints. For more information visit [endpoints](https://cloud.ibm.com/docs/account?topic=account-service-endpoints-overview).

![endpoints](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FPDCmierW14TQ3UKOh2td%2F8.PNG?alt=media\&token=9187bd4b-baa0-4b5b-976c-9ba2d21e840f)

* Give cluster a name

![name-new](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2Fo3RSrHuM4rzQOiZh5Mxt%2F9.PNG?alt=media\&token=aa024b4e-5ea1-41e0-bc45-92d6bba595b5)

* Give desired tags to your cluster; for more information, visit [tags](https://cloud.ibm.com/docs/account?topic=account-tag)

![tasg-new](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FTretwy2lMsszgG0GIx6d%2F10.PNG?alt=media\&token=104eab94-162a-4440-b0ee-d6a6a8b6edcc)

* Click create

![create-new](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FliLBM82oGdu21OSnHL37%2F11.PNG?alt=media\&token=725c30fe-2a64-4a71-a470-b767246c09c8)

* Wait for you cluster to be provisioned

![cluster-prepare](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FegKNLghDb5s7T1snzthc%2F12.PNG?alt=media\&token=54877a74-bf60-4e04-ac94-8d16f2bd5e2d)

* Your cluster is ready for usage

![cluster-done](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FzKlEixwCxbQGJGWhEA8N%2F13.PNG?alt=media\&token=5007438f-b7b8-46db-a205-6e616d7159c9)

## Step 2: Deploy IBM Cloud Block Storage Plug-in

The Block Storage plug-in is a persistent, high-performance iSCSI storage that you can add to your apps by using Kubernetes Persistent Volumes (PVs).

* Click the Catalog button on the top
* Select Software from the catalog
* Search for IBM Cloud Block Storage plug-in and click on it

![block-search](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FWLkcyEzQjplWDZHcXJ7e%2F14.PNG?alt=media\&token=df9f2d4a-0dc9-42bc-ae4b-cc86df853e89)

* On the application page Click in the dot next to the cluster, you wish to use
* Click on Enter or Select Namespace and choose the default Namespace or use a custom one (if you get error please wait 30 minutes for the cluster to finalize)

![block-cluster](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FSzqLNZXX6wGtOQ6t39gw%2F15.PNG?alt=media\&token=703191d4-ea1f-4118-a096-82c698dcc5f4)

* Give a name to this workspace
* Click install and wait for the deployment

![block-storage-create](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FvKdjQUAtHF2OXYMkJOnz%2F16.PNG?alt=media\&token=6715cfc6-0591-42be-bbfd-0fca97380993)

## Step 3: Deploy MariaDB Galera

We will deploy MariaDB on our cluster

* Click the Catalog button on the top
* Select Software from the catalog
* Search for MariaDB and click on it

![search](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FfdJhmhQg8rvIsuFHPBb5%2F17.PNG?alt=media\&token=6b826a30-e844-4333-a6f7-6e2e7ac850ce)

* On the application page Click in the dot next to the cluster, you wish to use

![cluster-select](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FlgpDkiOPa0K79IFmpmTB%2F18.PNG?alt=media\&token=e3717a1e-b895-4259-b645-2f35e2ecd12b)

* Click on Enter or Select Namespace and choose the default Namespace or use a custom one

![details-namespace](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2F875ciOAt8jiijfwaQ7ZP%2F19.PNG?alt=media\&token=f439e0f6-666c-4339-a28f-f7facc3b105e)

* Give a unique name to workspace, which you can easily recognize

![details-name](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FXqkpDQKBhacx56jqZzle%2F20.PNG?alt=media\&token=94871098-e442-4e55-aa30-70bf4d086ec4)

* Select which resource group you want to use, it's for access controll and billing purposes. For more information please visit [resource groups](https://cloud.ibm.com/docs/account?topic=account-account_setup#bp_resourcegroups)

![details-resource](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FJM2LPsvEOUfDGRKNT4rJ%2F21.PNG?alt=media\&token=055605fa-882b-4ae2-b9a9-bb02ea8b0e27)

* Give tags to your MariaDB Galera, for more information visit [tags](https://cloud.ibm.com/docs/account?topic=account-tag)

![details-tag](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2Fc0KXY987hEEi6erhpZBZ%2F22.PNG?alt=media\&token=76580d05-18f3-4c5e-bd5c-c6ac0e9ea7ae)

* Click on Parameters with default values, You can set deployment values or use the default ones

![parameters](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FCsFWsd2HqFkmTXC6Xw1M%2F23.PNG?alt=media\&token=fc20f937-29bf-4e24-868f-ec5ceabafebf)

* Please set the MariaDB Galera root password in the parameters

![password](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FdmRqEaIpC2Y47sDUCdsb%2F24.PNG?alt=media\&token=109b6309-0666-480d-96d1-b3892f45fe52)

* After finishing everything, tick the box next to the agreements and click install

![aggreement-create](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FL98IaWYcjVz3xUQTdm87%2F25.PNG?alt=media\&token=5a398777-2156-4510-89f3-5ffe7dd32e26)

* The MariaDB Galera workspace will start installing, wait a couple of minutes

![in-progress](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FCqGhGYEH9IbDwHtnQD7L%2F26.PNG?alt=media\&token=fbf945e4-5aeb-42e4-8905-154ae178d0a5)

* Your MariaDB Galera workspace has been successfully deployed

![done](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2F1coL4NN7Pkyg9jS5sjVv%2F27.PNG?alt=media\&token=d08c9d32-126e-4214-9cc8-bf556a068375)

## Verify MariaDB Galera Installation

* Go to [Resources](https://cloud.ibm.com/resources) in your browser
* Click on Clusters
* Click on your Cluster

![resource-select](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FBHERwpHH17x9i8BJr4Hb%2F28.PNG?alt=media\&token=79425b5d-5779-4c13-8f58-d7728cb46565)

* Now you are at your clusters overview, here Click on Actions and Web terminal from the dropdown menu

![cluster-main](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FXbGEmeRtSs15MZMBfIpb%2F29.PNG?alt=media\&token=0a4f909a-d24b-41f8-8dd8-edb4483f271d)

* Click install - wait couple of minutes

![terminal-install](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2F4bXic6EHFnFTLcRxORdl%2F30.PNG?alt=media\&token=95e4cf9a-522d-4677-b06b-4b0f1dca51a3)

* Click on Actions
* Click Web terminal, and a terminal will open up
* Type in the terminal; please change NAMESPACE to the namespace you choose at the deployment setup:

```
$ kubectl get ns
```

![get-ns](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FqVGplFIs3P1qSW2NsEvb%2F31.PNG?alt=media\&token=782581a3-2a24-4cb8-b7a8-0894f84b2c1f)

```
$ kubectl get pod -n NAMESPACE -o wide
```

![get-pod](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FeLmj6NWRr0cGdTEBzsJE%2F32.PNG?alt=media\&token=11855c00-fbf0-4942-81fe-a422be843773)

```
$ kubectl get service -n NAMESPACE
```

![get-svc](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FoNGInq6YbfU9VNHKcPpd%2F33.PNG?alt=media\&token=e3c9b84c-4e73-4929-854b-ed37b9bc4356)

* Enter your pod with bash; please replace PODNAME with your mariadb pod's name

```
$ kubectl exec --stdin --tty PODNAME -n NAMESPACE -- /bin/bash
```

![bash](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2F7YcaXPyAYMlzpydxPROi%2F34.PNG?alt=media\&token=b34463e3-c70c-40dd-bb1a-5e68f89a782f)

* After you are in your pod , please verify that MariaDB is running on your pod's cluster. Please enter the root password after the prompt

```
mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"
```

![welcome](https://1682030745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VYeeVGUV4AMqrA3zwy7%2Fuploads%2FCGkToe59Q6UyzryA4lFY%2F35.PNG?alt=media\&token=50d0ed8b-2f2d-4973-b353-187250add270)

You have successfully deployed MariaDB Galera on IBM Cloud!

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
