Y
Y
Yuri Petrashevich2015-04-15 14:01:34
MySQL
Yuri Petrashevich, 2015-04-15 14:01:34

One base for two servers. What are the implementation options?

The task is as follows:
there is server 1 and server 2, if server 1 for some reason could not process the request, then it (the request) is sent to server 2. It is necessary that both servers use the same database. How to do it the smartest way? The option to take a third server, put mysql on it and give a remote connection to two servers seems to me not very correct.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Igor, 2015-04-15
@BelCoder

Raise Bases on server 1 and server 2. Set up master-master replication between them.
Let the scripts on server 1 and 2 query the database by localhost so as not to make an external request to the second server.
If 2 servers are used to improve fault tolerance, then using a 3rd dependent server will only reduce it.
Let's say server 3 is down, then neither server 1 nor server 2 will have any meaning at all.

L
ldv, 2015-04-15
@ldvldv

Comparing different cluster implementations for MySQL?

P
PO6OT, 2015-04-15
@woonem

make a database with constant updating on both servers, that is, information goes to one database, and then the missing part from the first is copied to another. And protect yourself from breakdowns - if one server is broken, the second one has a complete copy of the database. Open external access to the database on both servers and let them exchange data over the local network.

E
Eugene, 2015-04-16
@Jon123

I am doing a similar task. in the project, data + files from one server (master) are transferred to several others. Change data only on the master. All done with php. Made as an experiment, but so far it works great. With a replica, the slave server receives logs from the master, and this is difficult for us. Due to the location of the master in the closed part of the Internet, it is completely closed from the outside. the master itself can send https requests, and they also transmit data. Additionally, symmetric encryption is used. So if the task is not standard - look for or develop non-standard solutions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question