Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up High availability Cluster under hp-unix

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to set up a highly available cluster under hp-unix. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

The principle of dual-machine backup: install cluster software (such as HP ServiceGuard) on two host nodes, and configure a floating IP for the client. Floating means that the IP address is timely bound to one of the two nodes, but the IP is fixed to the client. Each node is equipped with three network cards, namely data network card, heartbeat signal network card, and a network card for data and heartbeat backup. Data and heartbeat network card need to configure IP address, backup network card does not match, when data or heartbeat network card fails, backup network card automatically take over data or heartbeat network card IP address. When the ServieGuard starts, once the master node is abnormal, such as the primary node stops, the key processes of the application exit, the network interruption occurs, the standby node immediately starts the preset application, and binds the floating IP to the standby node. The switching time of the whole master and slave is about 2 minutes. After the switch, the client is transparently connected to the standby through the floating IP. When the primary node is troubleshooting, there are two strategies for whether to switch the standby node back to the primary node, one is manual switching, the other is automatic switching, and the default is manual switching.

The composition of ServiceGuard software:

Software component

Package Manager runs the package manager

Cluster Manager Cluster Manager

Network Manager Network Manager

Main background process

Cmcld: node daemon, responsible for sending heartbeats, managing the local network, and managing running packets

Cmlogd: responsible for recording information in the system log (syslog)

Cmlvmd: monitors the status of all volume groups (VG) that belong to the cluster control

Cmsrvassistd: responsible for package startup, stopping scripts and running service programs

The structure of the cluster

1. Node: the host that makes up the cluster. The number of nodes allowed in a cluster is 2-16.

2. The runtime package: the application that contains the user and the resources allocated to the application in the runtime package. The report runs on a running node and can be switched between nodes.

Some concepts about package

1. Include applications

2. Allocate the appropriate resources: ① volume group, logical volume and file system ② floating IP address ③ application start and stop script ④ service program

The rule is that resources assigned to one package cannot be allocated to other packages; a package can only run on one node at a time

The concept of floating IP

Floating IP is assigned to each application (running package). If you want to access an application, you need to connect a floating IP address. Just link to this address, regardless of which host or network card it is actually on.

The floating IP must be loaded on the network card with the static IP address of the same network segment. When the local network card switch occurs, the floating IP will be loaded on the standby network card together with the static IP.

The hardware conditions that make up the cluster

1. Hosts: multiple hosts form a cluster, and each host must have its own independent root disk. It is strongly recommended to mirror images.

2. Data disk: because MC/SG cannot respond to data disk failure, you need to use a high-availability disk array or mirror the data disk.

3. Network: network manager in MC/SG can respond to network failure. Redundant network devices (network cables, switches, network cards, etc.) need to be configured.

Cluster configuration-related files

1 、 / etc/cmcluster/cluster.ascii

Cluster configuration file, including node composition, volume group assignment and related parameter settings, etc.

2 、 / etc/cmcluster/cmclconfig

Cluster binaries, compiled from configuration files, contain all the information about the cluster

3 、 / etc/cmcluster/mscppkg/mscppkg.conf

Package configuration file, specifying the node where the package is located, monitoring network segment, switching mode and other parameter information

4 、 / etc/cmcluster/mscppkg/control.sh

Package control files that specify the various resources owned by the package

5 、 / etc/cmcluster/mscppkg/control.sh.log

Log recorded when the package is running

6 、 / etc/cmcluster/mscppkg/start_mscp.sh

The script used to start the application when the package starts

7 、 / etc/cmcluster/mscppkg/stop_mscp.sh

The script used to stop the application when the package is stopped

8 、 / etc/cmcluster/mscppkg/mscp_service.sh

Package service scripts to perform process monitoring and other customized functions

MC/SG running process-startup process

Start the cluster

1. Start the daemon cmcld on each node

2. All the nodes with cmcld running normally form a cluster

Startup package

1. Activate the volume group, load the floating IP, and suspend the file system

2. Execute the application launcher (start_mscp.sh)

3. Run the service (mscp_service.sh)

MC/SG running process-stop process

Stop the package

1. Stop the service (mscp_service.sh)

2. Execute the application stop script (stop_mscp.sh)

3. Unmount the file system and unmount the floating IP to activate the volume group.

Stop the cluster

1. Stop the daemon cmcld on each node

Cluster related commands

Start the cluster: cmruncl-v stop the cluster: cmhaltcl-v (add-f parameter if there is a package running) start the cluster on only one node: cmruncl-n node name to observe the entire cluster status: cmviewcl-v

Run package related commands

Startup package: cmrunpkg-v-n node name package name stop package: cmhaltpkg-v package name

Set the automatic switching attribute of the package: cmmodpkg-e package name (allows packets to automatically switch between nodes)

Cmmodpkg-e-n node name package name (allows the package to start on this node)

Run package management-manually switch package instances

Switch the package scppkg from mscp1 to mscp2:

Step 1: execute on any host

Cmhaltpkg-v scppkg

Step 2: execute on any host

Cmrunpkg-v-n scp2 scppkg

Step 3: execute on any host

Cmmodpkg-e scppkg

Log check-Syslog

/ var/adm/syslog/syslog.log Syslog

Log check-package log

/ etc/cmcluster/mscppkg/control.sh.log package run log

Emergency treatment plan

If there is an emergency, you need to start the application directly from the dual-computer software.

1. Execute vgchange-c n vgdata to make vg out of the control of MC

2. Execute vgchange-a y vdata to activate vg

3. Execute ifconfig lan 1:1 inet 129.168.120 netmask 255.255.255.0 manually bind the floating IP to the network card

4. Execute the package startup script in / etc/cmcluster/pkg/ or directly execute relevant commands to start the application and database

After the dual-computer configuration is restored

1. Stop the database and application

2. Execute ifconfig lan 1:1 0.0.0.0 to delete floating IP

3. Execute vgchange-an vgdata to activate vg

4. Execute cmruncl-v to start the cluster. The first startup will prevent the package from starting because vg cannot be controlled by MC.

5. When the cluster is in running state, execute vgchange-c y vgdata to add vg to MC control

6. Execute cmrunpkg-v pkg to launch the package

After reading the above, do you have any further understanding of how to set up a highly available cluster under hp-unix? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report