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 understand SEGMENT mirroring in configuration database high availability

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article shows you how to understand SEGMENT mirroring in configuring database high availability. The content is concise and easy to understand, and it will definitely shine before your eyes. I hope you can get something through the detailed introduction of this article.

The backup and recovery of the GREENPLUM database was introduced earlier. This section mainly introduces the high availability configuration of GREENPLUM. The high availability of GREENPLUM is achieved through mirroring of master and segment. This kind of image is based on a server-level image. Therefore, it can not only provide storage-level protection, but also prevent damage to other PC server hardware.

Segment-level mirroring is achieved by placing the mirror segment corresponding to primary segment on different physical hosts. Normally, only the instance of the primary segment is working, and all changes on the primary segment are copied to the mirror segment through the file block replication technology. Therefore, there are only replication processes on the host where the mirror segment is stored, and there is no mirror segment instance. Once primary segment fails, the replication process of mirror segment stops and instance is started to ensure that the operation of the database continues.

The fault detection of segment is realized through the background process ftsprobe, and can be fault-tolerant automatically without the intervention of DBA. The detection interval of ftsprobe is defined by the global service parameter gp_fts_probe_interval, and the default value is 1 minute. Usually, the setting of this parameter should be consistent with the parameter gp_segment_connect_timeout. Once the ftsprobe process finds that the primary segment is faulted, it marks in the data dictionary that the segment has stopped. The state will not change until it is restored by the administrator.

If the system is not mirrored at the segment level, when a segment failure occurs, the entire system goes offline and cannot be restarted until the failed segment is restored.

Enable segment mirroring, either when initializing the system or adding mirror to an existing system.

If you are required to add an image in the initialization system, you need to add the following parameters to the initialization configuration file

MIRROR_PORT_BASE specifies the port number of the first mirror segment, and the other mirror segment adds 1 to this. Its setting range is 1 to 65535, but be careful not to conflict with primary segment.

REPLICATION_PORT_BASE specifies the port number on which the first primary segment is used for data replication, and the other primary segment uses this as a basis, adding 1 at a time to calculate the port number for replication. Its settings also do not conflict with primary segment. Values range from 1 to 65535

MIRROR_REPLICATION_PORT_BASE specifies the port number on which the first mirror segment is used for data replication, and the other mirror segment uses this as a basis, adding 1 at a time to calculate the port number for replication. Its settings also do not conflict with mirror segment. Values range from 1 to 65535

MIRROR_DATA_DIRECTORY specifies mirror segment's data directories, the declared number of directories must be the same as the number of directories in primary segment, and ensure that the os user doing the initialization operation has read and write access to these directories.

Then initialize it by calling gpinitsystem, which defaults to making the hosts in the array store each other's mirrors. "if the number of hosts is greater than the number of segment, you can use the-S option to specify which hosts are used for mirroring."

If the existing system does not have a mirror, we can also add a mirror to the existing system. The first thing to do is to get the construction file that added the image. This file can be edited by yourself or automatically generated by gpaddmirrors, and then modified as needed. For example, automatically generate construction files that add mirror

$gpaddmirrors-o filename

When the text editor opens the construction file, you can see that it has the following format

Mirror [content] = content:hostname:address:port:mir_replication_port:pri_replication_port:datadir_location

The default configuration is that the original hosts mirror each other, and we can also add new hosts as mirrors to reduce the impact of mirroring on performance.

After you get the mirror construction file, you can disable the command to enable mirroring.

$gpaddmirrors-I mirror_config_file

At this time, the system will copy the mirror according to the configuration file settings, and synchronize the mirror to provide protection. It is important to note that the database should be backed up before adding mirrors to prevent failure in adding mirrors (such as network configuration problems, incorrect kernel parameters may lead to failure in adding mirrors). Because GREENPLUM can only add images, you cannot delete them. Failure to add a mirror will cause the system to be in an abnormal state.

Because mirror segment can automatically failover, administrators may not be aware of primary segment failures in a timely manner. So on the one hand, the administrator should check the system regularly, on the other hand, if the system performance drops significantly (in theory, if you mirror each other, when a host fails, the performance of the whole system will drop by half). The administrator should also check the system to determine whether any segment has been down.

Check whether segment down is dropped. You can execute gpstate on master. If you see something like this [WARN]:-Total primary segment failures (at master) = 1

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