Reprint: http://www.microcolor.cn/solutions/80.html
This manual focuses on the idea and steps of using the Microcolor Servhamirror/cluster software to complete a dual-machine high-availability cluster configuration for MySQL under the Windows operating system. Before using this manual, you need to complete the configuration steps for the Microcolor servha Mirror for Windows pre-order configuration guide or the MICROCOLORSERVHA Cluster for Windows pre-order configuration guide.
Directory
Microcolor servhaseries for Windows mysql application configuration Guide
I. Planning programme
1.1 InnoDB Path
1.2 MySQL service name
1.3 Summary Table
Second, pre-installation precautions
2.1 InnoDB Path
2.2 MySQL Service name
2.3 Instance Directory storage path
2.4 Modifying a configuration file
Third, install a machine database and examples
3.1 Installation
3.2 InnoDB Path
3.3 MySQL Service name
3.4 Stopping an instance
3.5 Modifying directory names
Iv. installation of B-machine database and examples
4.1 Installation
4.2 InnoDB Path
4.3 MySQL service name
4.4 Stopping an instance
Five, Manual Test
5.1 Manually start the B-Machine database service
5.2 Manually Stop the B-machine database service
5.3 Manually start the A-machine database service
5.4 Manually stop the A-machine database service
Vi. Building a resource tree
6.1 Building a resource tree
6.2 Adding resources
6.3 Drag Resource Tree
6.4 Testing the Resource tree
I. Planning programme
Before we begin to install and configure the MySQL database, we need to plan the MySQL configuration scheme to facilitate the subsequent installation steps.
1.1 InnoDB Path
In the dual-machine hot standby scheme, the InnoDB path of the dual-machine MySQL must be identical, otherwise it will cause the switchover to fail.
1.2 MySQL service name
During the MySQL installation process, a Windows MySQL service is created, and the service name must be the same for both machines.
1.3 Summary Table
Complete the planning and fill out table 1.3-1:
A-Machine InnoDB path |
|
B-Machine InnoDB path |
|
A-machine MySQL service name |
|
B-machine MySQL service name |
|
Table 1.3-1
For example, in table 1.3-1, the following configuration steps are configured as demonstrated in this example.
A-Machine InnoDB path |
S:\MySQL datafiles\ |
B-Machine InnoDB path |
S:\MySQL datafiles\ |
A-machine MySQL service name |
Mysql |
B-machine MySQL service name |
Mysql |
Table 1.3-2
Second, pre-installation precautions
Before you begin this step, make sure that you have completed the configuration steps for the Microcolor servhamirror for Windows pre-order configuration guide or the Microcolor servha Cluster for Windows pre-order configuration guide. To facilitate the subsequent operation.
This manual focuses on the steps and considerations for configuring a dual-machine hot standby in a MySQL program and its instance installation, and does not include a complete MySQL installation tutorial, other options are set according to the actual requirements. This manual installs the Mysql5.5 as an example, the installation process should pay attention to the following points:
2.1 InnoDB Path
The InnoDB path of the two-machine MySQL must be identical.
2.2 MySQL Service name
The two-machine MySQL service name must be the same.
2.3 Instance Directory storage path
The instance storage path for MySQL must be under a mirrored disk/shared storage disk. Open the configuration file My.ini in the MySQL installation directory to view the DataDir path. Copy the Data folder under this path to the mirrored disk/shared storage disk.
2.4 Modifying a configuration file
Modify the DataDir path under the My.ini file to point to the new storage path of the data file in the previous step.
Third, install a machine database and examples
The following steps are all operated on a machine.
Run servhaconsole and switch the resource tree to a machine.
3.1 Installation
Run the MySQL installation file, 3.1-1:
Figure 3.1-1
3.2 InnoDB Path
The InnoDB path of the two machines must be identical and must be installed under the mirrored disk/shared storage disk. 3.2-1:
Figure 3.2-1
3.3 MySQL Service name
Fill in the service name for an instance.
Figure 3.3-1
3.4 Stopping an instance
Select the MySQL service in the A-machine service list and stop.
3.5 Modifying directory names
Rename the MySQL file under the mirror disk/shared storage disk (InnoDB folder and DB instance folder), this operation is to avoid the occurrence of file name conflict when creating DB instance in B machine, once the cluster configuration is complete, the renamed directory can be completely deleted.
Iv. installation of B-machine database and examples
Run the Servhaconsole console and switch the resource tree to machine B.
4.1 Installation
Run the MySQL installation file, 4.1-1:
Figure 4.1-1
4.2 InnoDB Path
The InnoDB path must be installed on a mirrored disk/shared storage disk and must be consistent with the a machine, 4.2-1:
Figure 4.2-1
4.3 MySQL service name
Fill out a MySQL service name, where service names must match the service name of a machine.
Figure 4.2-2
4.4 Stopping an instance
Select the MySQL service in the B-Machine Windows Services list and stop.
Five, Manual Test
This step is primarily to detect if the installation is normal.
5.1 Manually start the B-Machine database service
To switch the resource tree to machine B:
Right-click on the Resource root node and click "Start Resource Tree" in the popup menu, 5.1-1:
Figure 5.5-1
In the list of services for machine B, select MySQL service and start.
5.2 Manually Stop the B-machine database service
Select the MySQL service in the list of Windows services and stop.
5.3 Manually start the A-machine database service
Switch the resource tree to a machine.
In the list of Windows services for machine A, select the MySQL service and start.
5.4 Manually stop the A-machine database service
In the list of Windows services for machine A, select the MySQL service and stop.
Vi. Building a resource tree 6.1 establishing a resource tree
In the Microcolor servha Mirror forwindows Pre-order configuration manual or Microcolorservha Cluster for Windows pre-order configuration Guide As shown in the resource tree we established in 6.1-1, next add the MySQL service resource to the resource tree.
Figure 6.1-1
6.2 Add a Resource 6.2.1 new service resource
Select the above established resource tree, click "Services" in the toolbar, add service resources, 6.2.1-1:
Figure 6.2.1-1
6.2.2 Select Service
Click the "Select Service" button on the right, pop up the service selection list, SERVHA will automatically filter the dual-machine service, select the MySQL service in the list of services, click the "Select" button (if the MySQL service startup type is not "manual" then you will be prompted to set it to Manual, select "Yes"), after saving as:
Figure 6.2.2-1
6.3 Drag Resource Tree
Drag the resource tree dependency, select the IP Address resource (192.168.1.73), hold down the left mouse button, drag it to the MySQL main service, also drag the mirror/shared storage disk resources to the MySQL master service, drag, the resource tree 6.3-1:
Figure 6.3-1
6.4 Testing the Resource tree
At this point, SQL Server dual-machine cluster is fully configured, the A-machine resource tree can be started after the service, and then manually switch the resource tree to B machine to see if the resource tree can start normally. At this point the IP Address resource is the cluster external service address (that is, 192.168.1.73).
MySQL database dual-Machine hot standby scheme