The answer is A, B, and D. These are three methods that are supported to run multiple instances of MySQL Server on a single host.
A. Run MySQL Server docker containers. This method allows you to run multiple isolated instances of MySQL Server on a single host using docker, a software platform that enables you to build, run, and share applications using containers. Each container has its own network interface, file system, and process space, and can be configured with different options and parameters. You can use the official MySQL Server docker image or create your own custom image based on your needs1.
B. Use systemd with different settings for each instance. This method allows you to run multiple instances of MySQL Server on a single host using systemd, a system and service manager that controls how services are started, stopped, and managed. You can create different systemd service units for each instance, and specify different options and parameters for each unit, such as the data directory, the port number, the socket file, and the configuration file2.
D. Start mysqld or mysqld_safe using different option files for each instance. This method allows you to run multiple instances of MySQL Server on a single host using mysqld or mysqld_safe, the MySQL server programs that handle the actual database operations. You can start each instance manually from the command line, and specify different option files for each instance, such as my.cnf or my.ini. Each option file should contain different values for the options that must be unique per instance, such as the data directory, the port number, the socket file, and the log files3.
The other methods are not supported or not recommended for the following reasons:
C. Use system tools to lock each instance to its own CPU. This method is not supported by MySQL, and it is not necessary to lock each instance to its own CPU. MySQL can run multiple instances on a single host without any CPU affinity settings, and it can use the available CPU resources efficiently. If you want to limit the CPU usage of each instance, you can use the resource groups feature, which allows you to assign threads to specific resource groups and control their CPU allocation and priority4.
E. Run mysqld with --datadir defined for each instance. This method is not sufficient to run multiple instances of MySQL Server on a single host, because it only specifies the data directory for each instance, which is one of the options that must be unique per instance. However, there are other options that must also be unique per instance, such as the port number, the socket file, and the log files. If you use this method, you will encounter conflicts and errors between the instances5.
F. Use resource groups to lock different instances on separate CPUs. This method is not recommended, because resource groups are designed to manage the CPU allocation and priority of threads within a single instance, not across multiple instances. If you use this method, you will create unnecessary complexity and overhead, and you will not be able to take advantage of the dynamic CPU scheduling and load balancing that MySQL provides. Resource groups are useful for controlling the CPU usage of different types of workloads, such as OLTP or OLAP, within a single instance4.