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 remove nodes by Greenplum

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

In this issue, the editor will bring you about how to remove Greenplum nodes. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

For some reason, our Greenplum needs to uninstall a node (the Greenplum cluster of the test environment). Because the cluster has been used for a long time and contains a lot of data needed for development, it is necessary to ensure that the data will not be lost after removing a node.

After searching, a solution was found at the following sites

1) https://gp-docs-cn.github.io/docs/admin_guide/managing/restore-diff-system.html

2) https://yq.aliyun.com/articles/173472

Of course, I also encountered some problems during this period, so I would like to make a summary and record here.

one, Backup data [this time using gp_dump backup] gp_dump [- a |-s] [- c] [- d] [- n schema] [- o] [- O] [- t table_name] [- T table_name] [- x] [- h hostname] [- p port] [- U username] [- W] [- I] [- v] [--gp- C] [- gp-d=backup_directory] [--gp-r=reportfile] [--gp-s=dbid [ ...]] Database_namegp_dump -? |-- help gp_dump-- version

The simplest way to use this instruction is

Gp_dump database_name

That is, directly follow the name of the database to be backed up.

As shown in the figure above, the wrong time is used on the file and the storage location of the backup file on each node.

2. Copy the backup files from the removed node to the master node. 3, remove nodes from the cluster

1) close the database gpstop-M fast2) start the database gpstart-m3 in administrative mode) Log in to the management database PGOPTIONS= "- c gp_session_role=utility" psql-d postgres on the master node

4) View the current node select * from gp_segment_configuration

5) set operation permission set allow_system_table_mods='dml'

6) Delete node (161b) delete from gp_segment_configuration where dbid=2;delete from pg_filespace_entry where fsedbid=2

Note: it is important here that we need to modify the deleted discontiguous index to be contiguous through update, otherwise the following error will be reported at startup:

[gpadmin@ultra-hp-157 root] $gpstart-a20190427 gpstart:ultra-hp-157:gpadmin- 1915 gpstart:ultra-hp-157:gpadmin- [INFO]:-Starting gpstart with args:-a20190427 Starting gpstart with args:-20190427 gpstart:ultra-hp-157:gpadmin- [INFO]:-Gathering information and validating the environment...20190427:13:45:19:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 5.0.0-alpha. 8 build commit:548dc837c957d8c4834445b642cda1f0a5bf9b66'20190427:13:45:19:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Greenplum Catalog Version: '301705051: 20190427 gpstart:ultra-hp-157:gpadmin- 1345 gpstart:ultra-hp-157:gpadmin- 19gpstart:ultra-hp-157:gpadmin- [INFO]:-Starting Master instance in admin mode20190427:13:45:20:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Obtaining Greenplum Master catalog information20190427:13:45:20:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Obtaining Segment details from master...20190427:13:45:21:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Setting new master era20190427:13:45:21:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Master Started...20190427:13:45:21:002659 gpstart:ultra-hp-157:gpadmin- [INFO]:-Shutting down master20190427:13:45:22:002659 gpstart:ultra-hp-157:gpadmin- [CRITICAL]:-gpstart failed. (Reason=''NoneType' object has no attribute 'valid'') exiting...7) exit management mode and start database gpstop-mgpstart8 normally) restore the backup files of deleted nodes to the current data using psql, for example: psql ioss_dns-f / data/greenplumdatabak/dump_161/gp_dump_0_2_20190427074146

Where ioss_dns is the database name and gp_dump_0_2_20190427074146 is the backup data file.

At this point, the node was removed successfully.

The above is to back up the data through the way of parallel backup, and the data of each database will be backed up on each node, that is, the data backup files are scattered on each node. In addition, the data can be backed up in a non-parallel way, the principle is that all the data is backed up to the master node, which is more practical when the amount of data is small.

The above is what the editor shares with you on how to remove nodes from Greenplum. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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

Internet Technology

Wechat

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

12
Report