[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Multiple instances (pods) of one Database in OpenShift V3



Hi Lorenz,

Can you provide us with a "oc build-logs" of the build that are failing?

From the command line you can do something like this to get that information

# oc project projectN
# oc get builds
NAME                                  TYPE      STATUS    POD
xxxxx-1              Source    Failed   xxxxx-1-build
xxxxx-1-0564234822   Source    Failed    xxxxx-1-0564234822-build
xxxxx-1-3343724358   Source    Running   xxxxx-1-3343724358-build
# oc build-logs xxxxx-1-0564234822
<< this is the log of the building of the container >>
#

Also take note that the application that you are replicating should support beeing replicated.
For a web services that is easy , for a Database may not be that easy ;)

Regards

On 11/18/2015 07:16 AM, Lorenz Vanthillo wrote:
I had one mysql pod with one container using persistent storage (NFS). This is working well.
But now I scaled the database to 3 replicas. The first replica (the original) remains stable.
But the other keeps deleting and recreating their container (pod remains existing).
They look to work fine. Every new addition in the db remains and is detected by every database. The only issue is that the container keeps recreating.

It keeps pulling the image:
Successfully pulled image "openshift/mysql-55-centos7 sha256:2946218cb0312967a6dea7f8001c6e25afb6a1192ad46205ee2f1b05ba379bae" (7 times in the last 11 minutes)

So this is normal because I'm not working with the master-slave scenario like you explained in Q1?


From: bparees redhat com
Date: Tue, 17 Nov 2015 09:14:30 -0500
Subject: Re: Multiple instances (pods) of one Database in OpenShift V3
To: lorenz vanthillo outlook com



On Tue, Nov 17, 2015 at 8:47 AM, Lorenz Vanthillo <lorenz vanthillo outlook com> wrote:
Thank you, the link explains a lot.
Q2: What will happen when I access one of the running db-containers and I change some column or add some table?
Will PostgreSQL do this?


​This is handled in the same way as any data update to the DB, so again it depends on you having a proper cluster/replication setup defined.  If you do, the change will be replicated among the members, if you don't, it will not.



 


From: bparees redhat com
Date: Tue, 17 Nov 2015 08:28:51 -0500
Subject: Re: Multiple instances (pods) of one Database in OpenShift V3
To: lorenz vanthillo outlook com
CC: users lists openshift redhat com




On Tue, Nov 17, 2015 at 2:46 AM, Lorenz Vanthillo <lorenz vanthillo outlook com> wrote:
Hi,

I'm wondering what will happen when you have multiple instances (pods) of one database running. I don't have a test-environment at the moment so that's the reason I have to ask this.
So for example:
- In the beginning you have one MySQL service with one RC and one pod which contains one running container of mysql. It will use persistent storage.
- I will do some configuration on the DB and add some data. After it, I will scale the existing pod with the help of my RC. Until I have 5 instances running of my database. They are all the same.
--> Q1: Will they contain the same data after the scaling? I would think so.
When I'm connecting the DB to an existing application, I assume that all the instances will contain the same data when I add some data via the application. A broken pod will be rebuild and contain the same data thanks to persistent storage.

​ Yes, they're going to share the same persistent volume claim which means they're going to all have the same shared storage mount (this may depend somewhat on your persistence volume filesystem, but it's definitely the case for NFS).  This immediately points to the reason you can't actually scale your DB up this way, because all those instances are going to step on each other trying to access the same files on that shared storage.

To see an illustration of how to scale up mysql, please see:
https://github.com/openshift/mysql/tree/master/5.6/examples/replica

 
--> Q2: What will happen when I access one of the running db-containers and I change some column or add some table?

​ Depends on your DB but in the case of mysql, again, sharing the filesystem between running instance is not going to work the way you want it to.​

 
(I'm afraid the change will only be effective on the datbase I accessed)
--> Q3: What will happen when I access one of the running db-containers and I add some data?
(To me it looks pretty the same as Q1 so I think the data will be in every container after that, thanks to persistent storage).


​ Again, this is not going to work if all your DB instances are sharing the same files.  You need, at a minimum, separate directories within the shared storage volume, for each instance.  The MySQL example above uses a single master with persistent storage, and then N slave replicas which each use EmptyDir storage meaning each one gets its own private (but non-persistent) storage.  Changes are replicated between them and if a slave fails, it will get a new copy of the DB via replication when it is restarted.  If the master fails, it will re-attach to the persisted storage on restart, retaining the DB content.

 
Thanks

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




--
Ben Parees | OpenShift




--
Ben Parees | OpenShift



_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

--
Pablo Halamaj
Arquitecto de Soluciones
Semperti 
San Martin 574 5º C1004AAL CABA
tel     : +54 11 5236 9939
móvil : +54 911 3689 9786

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]