Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Say every container and the host itself has its own dedicated, external IP. Is it possible to do this without any problems?

And is this really a good plan? Instead of hosting a database per container, hosting a database per host, for all containers to share?

This question is sort of related to this one: https://unix.stackexchange.com/questions/114786/giving-ovz-containers-their-own-ip

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I do this exact same thing, I have ~10+ OpenVZ guests and a single instance of MySQL running in one of the 10. This is a good approach if the following things are true:

  • All the VM's using this DB won't overload it
  • Running multiple individual MySQL instances in their own VMs would be more resource intensive
  • All the guest VMs that are talking to the single instance of MySQL can be coordinated to have it (MySQL) down when doing maintenance, backups, etc.

From a technology standpoint OpenVZ can definitely do this, it really comes down to what expectations the applications and other VMs are expecting the database "service" to be available.

I think you're confusing the situation due to the technology being used. There is nothing inherent in OpenVZ that will disallow you from setting up this kind of architecture. OpenVZ will allow you to loosely "wall off" instances of applications and allow you to create multiple hostnames for the varying services, if you so choose, but otherwise it's no different then if you were to spin up 10 machines with 10 instances of Apache running on them, with a single host running MySQL.

share|improve this answer
    
Since the dedicated server has its own external ip I can can configure all the server to connect to the mysql process on that ip correct? –  Dominique Feb 12 at 22:48
    
@Dominique - Correct! –  slm Feb 12 at 22:49
add comment

OK, the question is: is it a good plan to have one MySQL-Database on a hardware node to server all VM, or is it better to have the MySQL-Database on a VM.

As always it depends on what are your requirements. If you are paranoid enough and security is most important, then have your DB on a VM. If performance is most important, than it would be better to put your DB on the hardware node.

share|improve this answer
    
I wanted to avoid using a separate VM for mysql because I need max performance. Securoty is important as well so I am at an impasse. –  Dominique Feb 12 at 22:49
    
Well than test it. It doesn't take much time to move from hardware node to VM and vice versa. –  bersch Feb 12 at 23:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.