Cluster Apache Mysql (MariaDB)

0

I am configuring a local server on 4 Linux cluster machines Raspbian Stretch. Right now I have apache configured with balancer-manager to distribute the traffic to the corresponding computer according to the web that is requested.

The websites are hosted on each server in a separate cluster, and what I want is that all the hosting go to a single hard drive hosted on another server that has it mounted.

Is this possible?

EDIT

Scheme that I currently have:

  • Cluster Master
    • Apache2 (Proxy Balancer-Manager) - > Redirect traffic to slaves
  • Cluster Slave 1
    • Apache2, PHP7, MariaDB, PhpMyAdmin, Hosting
    • VirtualHosts
  • Cluster Slave 2 and 3
    • Copy of Slave 1 (obviously changing IP's)

Right now what I need is to be able to configure:

  • Access FTP from outside my home and access slave cluster according to need.
  • Access each PhpMyAdmin of each VirtualHost.

As I said above, the first idea, which I have already ruled out in a response to excessive traffic, was to host everything on a separate hard drive.

Now I rethink it and I would like advice on how to assemble it so that a home cluster works in conditions.

Currently I already have a home server (without cluster) mounted and working perfectly. The fact of having a mini-custer at home for development and samples, is not because it has a lot of traffic, but it starts not to process some requests.

    
asked by Jordi Huertas 22.11.2017 в 20:54
source

1 answer

1

I do not know if I understand you correctly (edit the question if it is not so that it is better understood) but you want the files to be "shared" by all the servers and only have one of them.

In this case what you have to mount is a NFS You can also do it with shared folders samba or with SSHFS

If it's going to be between 'Linux' systems, I recommend NFS or SSHFS , if you also want a system Windows to access, it has to be samba .

The problem with this is the latency of the system itself, since both the access and the writing of the files is done by network, much slower than if you had local access.

For what I see that you have mounted, what you want is redundancy in case one falls, and probably fall by resource consumption or by requests / load. Having those files shared by network makes requests slower since access to those resources is also slow.

One solution is to use Gluster that in theory (and because of the tests I have been able to do it works) it does not have that limitation, but it also requires more hardware .

Edit:

What you are saying is the following, I answer for each part:

  

Access FTP from outside my house and access cluster slave   according to need.

You can do a NAT de ports between those servers and your IP publishes so you can access the FTP of each of the machines from the ports that you set yourself, I recommend two things:

  • Start from port 62162
  • Use SFTP which is basically SSH through FTP with port 22 or the one you have set in SSH
  • Never expose directly the port SSH expose in its absence any jump machine, from which you jump to the others, not all at once. So you have a single point of entry and if something happens you can cut it.
  

Access each PhpMyAdmin of each VirtualHost.

I do not recommend it is a very fat security failure to use PhpMyAdmin , anyone can catch it and attack it until it gets bored. I recommend using MysqlYog or MySQLWorkbench through a tunnel SSH , it is much more secure and you can also limit the access by IP so they can not attack your MySQL , in MySQL you can limit the connections to localhost and so nobody else can access. Then with the tunnel you connect via SSH and then to MySQL as localhost .

    
answered by 23.11.2017 / 08:39
source