Este conteúdo não está disponível no idioma selecionado.
Appendix B. Configuration Example Using pcs Commands
This appendix provides a step-by-step procedure for configuring a two-node Red Hat Enterprise Linux High Availability Add-On cluster, using the
pcs command, in Red Hat Enterprise Linux release 6.6 and later. It also describes how to configure an Apache HTTP server in this cluster.
Configuring the cluster provided in this chapter requires that your system include the following components:
- 2 nodes, which will be used to create the cluster. In this example, the nodes used are
z1.example.comandz2.example.com. - Network switches for the private network, required for communication among the cluster nodes and other cluster hardware such as network power switches and Fibre Channel switches.
- A power fencing device for each node of the cluster. This example uses two ports of the APC power switch with a host name of
zapc.example.com.
B.1. Initial System Setup Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
This section describes the initial setup of the system that you will use to create the cluster.
B.1.1. Installing the Cluster Software Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
Use the following procedure to install the cluster software.
- Ensure that
pcs,pacemaker,cman, andfence-agentsare installed.yum install -y pcs pacemaker cman fence-agents
yum install -y pcs pacemaker cman fence-agentsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - After installation, to prevent
corosyncfrom starting withoutcman, execute the following commands on all nodes in the cluster.chkconfig corosync off chkconfig cman off
# chkconfig corosync off # chkconfig cman offCopy to Clipboard Copied! Toggle word wrap Toggle overflow
B.1.2. Creating and Starting the Cluster Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
This section provides the procedure for creating the initial cluster, on which you will configure the cluster resources.
- In order to use
pcsto configure the cluster and communicate among the nodes, you must set a password on each node for the user IDhacluster, which is thepcsadministration account. It is recommended that the password for userhaclusterbe the same on each node.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Before the cluster can be configured, the
pcsddaemon must be started. This daemon works with thepcscommand to manage configuration across the nodes in the cluster.On each node in the cluster, execute the following commands to start thepcsdservice and to enablepcsdat system start.service pcsd start chkconfig pcsd on
# service pcsd start # chkconfig pcsd onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Authenticate the
pcsuserhaclusterfor each node in the cluster on the node from which you will be runningpcs.The following command authenticates userhaclusteronz1.example.comfor both of the nodes in the example two-node cluster,z1.example.comandz2.example.com.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command from
z1.example.comto create the two-node clustermyclusterthat consists of nodesz1.example.comandz2.example.com. This will propagate the cluster configuration files to both nodes in the cluster. This command includes the--startoption, which will start the cluster services on both nodes in the cluster.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Optionally, you can enable the cluster services to run on each node in the cluster when the node is booted.
Note
For your particular environment, you may choose to leave the cluster services disabled by skipping this step. This allows you to ensure that if a node goes down, any issues with your cluster or your resources are resolved before the node rejoins the cluster. If you leave the cluster services disabled, you will need to manually start the services when you reboot a node by executing thepcs cluster startcommand on that node.pcs cluster enable --all
# pcs cluster enable --allCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You can display the current status of the cluster with the
pcs cluster status command. Because there may be a slight delay before the cluster is up and running when you start the cluster services with the --start option of the pcs cluster setup command, you should ensure that the cluster is up and running before performing any subsequent actions on the cluster and its configuration.