# Multiple instances

**URL:** <https://forums.percona.com/t/multiple-instances/8754>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [January 12, 2021, 8:59pm UTC](https://forums.percona.com/t/multiple-instances/8754 "2021-01-12T20:59:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rokj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rokj/32/1470_2.png) [@rokj](https://forums.percona.com/u/rokj)\
**Post date:** [January 12, 2021, 8:59pm UTC](https://forums.percona.com/t/multiple-instances/8754/1 "2021-01-12T20:59:29Z")

</div>

Hi,

we are considering to setup multiple instances of percona 5.7 and 8.0 (from binary) little bit different than “recommended” way in tutorials.

Is it “ok” to run multiple instances with systemd with separate mysql config files for e.g.:  
/etc/percona-57-one.cnf  
/etc/percona-57-two.cnf  
/etc/percona-80-one.cnf  
/etc/percona-80-two.cnf

while in /etc/systemd/system:  
mysql-57-one.service  
mysql-57-two.service  
mysql-80-one.service  
mysql-80-two.service

where all binaries, datadirs, pid, logfiles are set to different values based on which instance is run.

Or would this setup “break” something?

---

<div class="post-metadata">

**Author:** ![vadimtk](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadimtk/32/9528_2.png) [@vadimtk](https://forums.percona.com/u/vadimtk)\
**Post date:** [January 12, 2021, 10:11pm UTC](https://forums.percona.com/t/multiple-instances/8754/2 "2021-01-12T22:11:05Z")

</div>

This setup should work.  
The only cation I would have, is that you need be careful and when you do shutdown or backup operation you make sure you do this on the correct instance.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 12, 2021, 10:19pm UTC](https://forums.percona.com/t/multiple-instances/8754/3 "2021-01-12T22:19:39Z")

</div>

Hi @rokj This is a perfect use-case for something like Docker or LXC. Each container runs inside its own process space, and stores data inside its own volume. Each container has a unique IP and they all use the same paths for the config files. docker stop/start will do safe starts and shutdowns for the mysql as well. Running a docker implementation would be far easier to manage, IMO, than the multi-config/multi-datadir you have shown.

---

<div class="post-metadata">

**Author:** ![rokj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rokj/32/1470_2.png) [@rokj](https://forums.percona.com/u/rokj)\
**Post date:** [January 13, 2021, 10:48am UTC](https://forums.percona.com/t/multiple-instances/8754/4 "2021-01-13T10:48:10Z")

</div>

Thank you both for answers.

Yes I am considering using LXC or Docker also… however I am little hesitant since it would bring another layer of complexity (another software to be aware of or watch).

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [January 13, 2021, 11:16am UTC](https://forums.percona.com/t/multiple-instances/8754/5 "2021-01-13T11:16:49Z")

</div>

[MySQL :: MySQL 8.0 Reference Manual :: 4.3.4 mysqld\_multi — Manage Multiple MySQL Servers](https://dev.mysql.com/doc/refman/8.0/en/mysqld-multi.html) might be useful for you as well
