How to make two node cluster of postgres in google cloud? - postgresql

I am currently working on google cloud sql. where i have make one single instance of postgres server. i want to build two node postgres cluster with both nodes active.
How can i built it. any help/tutorial or link regarding to it will be highly appreciated.
Thanks

Cloud SQL for Postgres Beta currently does not support any form of High Availability [1].
If this is something you require immediately, you would need to run the nodes yourself or use another solution.
[1] https://cloud.google.com/sql/docs/postgres/high-availability

Related

Compute engine instance move

I have a wordpress site installed on a compute engine instance.
I would like to move it on a new instance with SSD disk and other region as now it runs on standard persistence disk and Google opened new datacenter in my country.
I have upgrated the Ubuntu server to get HTTP/2 support and installed ssl keys for the https support.
Is there a way to move the existing instance with all configuration to new without needing to do it all again?
I read about the disk snapshots but am not sure if it includes everything from the old instance or is it just partial (missing the server update, ssl keys etc)?
It would be great if you guys could help me out because I am a Google cloud noobie with limited technical knowledge.
Thank in advance!
If you're looking to move the compute engine instance to another zone within the same region you can simply just use the gcloud compute instances move command in the Google Cloud shell to move it to a different zone.
Quote from the documentation:
For example, running
gcloud compute instances move example-instance-1 \
--zone us-central1-b --destination-zone us-central1-f
Will move the instance called example-instance-1 with its all attached
persistent disks, currently running in us-central1-b, to
us-central1-f.
References:
https://cloud.google.com/compute/docs/regions-zones/
https://cloud.google.com/sdk/gcloud/reference/compute/instances/move
https://cloud.google.com/compute/docs/instances/moving-instance-across-zones

real-time sync between local Postgres instance and Azure Cloud Postgres instance

I need to set up real time sync process between a on premise postgresql instance with cloud postgresql instance. Please let me know what are all the options available through which i can achieve it.
Do i have to use any specific tool or it can be managed through replication .
Please advice
Use PgPool
http://www.pgpool.net/mediawiki/index.php/Main_Page
from their web page:
pgpool-II can manage multiple PostgreSQL servers. Using the replication function enables creating a realtime backup on 2 or more physical disks, so that the service can continue without stopping servers in case of a disk failure.

Setting up backup strategy for backing up postgresql database on cloud foundry

We have setup a community postgresql service on Cloud Foundry (IBM Blumix). This is a free service and no automated backup and recovery is supported out of the box.
Is there a way to set up a standby server or a regular backup in case there is any data corruption/failure?
IBM compose and ElephantSQL can provide this service at a cost, butwe are not ready for it yet.
PostgreSQL is an experimental service and there is not a dashboard and other advanced features (Daily backup for example) that you can find in other services that you mentioned. If you want to do a backup you could write an ad-hoc script that 'saves'\exports all tables as you want and run it every day.
If you need PostegreSQL you can create a PostegreSQL by compose service $17.50 / mo for the first GB and $12 for Extra GB )
We used Postgresql Studio and deployed it on IBM Bluemix. The database service was connected to the pgstudio interface (This restricts the access to only connected databases). We also had to make minor changes to pgstudio so that we could use pg_dump with the interface.
The result: We could manually dump the data. This solution works well as we could take regular dumps (though manually).
In the free tier you are right in saying that you cant get the backup. Those features are available only in Compose for PostgresSQL service - but that's a paid service.

How to replicate MySQL database to Cloud SQL Database

I have read that you can replicate a Cloud SQL database to MySQL. Instead, I want to replicate from a MySQL database (that the business uses to keep inventory) to Cloud SQL so it can have up-to-date inventory levels for use on a web site.
Is it possible to replicate MySQL to Cloud SQL. If so, how do I configure that?
This is something that is not yet possible in CloudSQL.
I'm using DBSync to do it, and working fine.
http://dbconvert.com/mysql.php
The Sync version do the service that you want.
It work well with App Engine and Cloud SQL. You must authorize external conections first.
This is a rather old question, but it might be worth noting that this seems now possible by Configuring External Masters.
The high level steps are:
Create a dump of the data from the master and upload the file to a storage bucket
Create a master instance in CloudSQL
Setup a replica of that instance, using the external master IP, username and password. Also provide the dump file location
Setup additional replicas if needed
VoilĂ !

Deploy Zend Application to the cloud

Was wondering if anyone out there has any experience in deploying a Zend community app to the cloud (e.g. AWS or similar)?
I'm new to cloud hosting having always been fortunate enough in the past to work for folks who have dedicated servers, my main concern (non-zend specific) is how you manage resilience at the database level? FOr example I would in a traditional setup have 2 boxes running the DB (Mysql) in Master/Slave mode with the master replicating to the slave. Assuming any HD failure of the Master I could swap the DB connection over from the Master to the slave and rebuild master at a later point? is this done differently in the cloud?
Any help/pointers greatly appreciated?
It depends on the type of cloud service that you use. If you're using AWS to get your own virtual machine ( Amazon EC2 ) then it's basically the same as having a dedicated server and you can keep a master slave setup and work them much the same way.
However, if you plan on using Amazon's cloud database service ( Amazon Simple DB ) then you don't have to worry about masters and slaves since Amazon does this for you and makes sure that you always have access to your data. The only thing is that it's in beta.
One of the points of the cloud is to take your mind off the hardware. Amazon worries about that.
You might still want to have two virtual machines in case amazon is doing maintenance that might cause your vm to become unavailable, however, Amazon stresses that it would be highly available and never go down really, so long as you pay.