CLI Design for managing Greenplum Cluster

61 views
Skip to first unread message

Piyush Chandwadkar

unread,
Jan 25, 2023, 1:41:31 PM1/25/23
to Greenplum Developers

Hello GPDB Community, 
As part of improving user experience when managing the greenplum cluster, we are planning to write utilities for cluster management in GoLang. Current plan is to have single command with sub-commands to manage the cluster (instead of separate command/utility for each operation like gpinitsystem, gpstart and …). 

The thought is to have gp_ctl utility (GP Control Utility like pg_ctl) which can be used for tasks such as initialization of cluster, starting/stopping cluster, checking the state and perform recovery. 
 

We will implement the functionality in phases, starting with cluster initialization. The new syntax for utility, planning to provide alongside current utilities and not as replacement for GPDB7. 

Convention used for the utility: 

       command sub-command [object] [flags/options/arguments] 

Note: object in this case refers to cluster to operate on which will be specified using data directory path. 

Some examples: 

   gpctl version: prints utility version 

   gpctl help: prints general help message and supported options 

   gpctl start  

   gpctl stop 

   gpctl expand 

For gpctl init following will be the options: 

   gpctl init <input-file>: Creates cluster from the provided input configuration. On error, stops execution at first failure. The input file will be self-sustained and contain all the information required to create the cluster. 

If wish to change any configuration from previous run, then can provided modified input-file – it will result in deleting previous incomplete/failed installation and start fresh installation. gpctl init: Resumes execution if was interrupted in previous runs. Will use the parameter and inputs from the last saved run 

   gpctl init status: Shows configuration used and status of last execution – COMPLETED, FAILED (then at what step in state machine) 

   gpctl init help: prints cluster initialization help 

   gpctl init cleanup: clears all data from previous run from all hosts. If no data is available, prints no previous run data available 

  

Will be having separate discussion on input-file format for initializing the cluster and design for the same. 

Thoughts? 

Thanks & Regards, 

Piyush

Piyush Chandwadkar

unread,
Jan 26, 2023, 5:07:35 AM1/26/23
to gpdb...@greenplum.org

Hello GPDB Community, 
As part of improving user experience when managing the Greenplum cluster, we are planning to write utilities for cluster management in GoLang. Current plan is to have single command with sub-commands to manage the cluster (instead of separate command/utility for each operation like gpinitsystem, gpstart and …). 

Regards,
Piyush 

 

Kirill Reshke

unread,
Jan 27, 2023, 4:24:13 AM1/27/23
to Greenplum Developers, pchand...@vmware.com
Hi! Interesting idea, I appreciate your efforts. Having a single utility to manage the whole cluster seems meaningful, but I'm not sure. Speaking of PostgreSQL, in PostgreSQL, there are pg_ctl and initdb are separate utilities, and probably for a reason. But anyway, curious to see how it will work! Will development be open source?

Craig Sylvester

unread,
Jan 27, 2023, 9:11:16 AM1/27/23
to Greenplum Developers, Piyush Chandwadkar
I like this direction. I would also assume there would be a gpctl status command to show the current state, hopefully something that can be easily consume in scripts. gpstate is too wordy when most of the time I just want to know is the instance up (and all green), down, in utility/restricted mode, etc.
And how about gpctl init -o <sample config> to spit out a template that can be filled in? Having to hunt for the example configs in the binary directory is kind of a pain-in-the-xxx.

And while I'm asking, anything that can be done to help with automation thru tools like ansible, chef, puppet, etc would be appreciated.Nothing necessarily specific to a tool set but having GP utiis have an option to output in structured text (i.e., json or xml) would make things easier to parse.

Thanks

Ashwin Agrawal

unread,
Jan 27, 2023, 11:33:13 AM1/27/23
to Kirill Reshke, Greenplum Developers, pchand...@vmware.com
On Fri, Jan 27, 2023 at 1:24 AM Kirill Reshke <reshke...@gmail.com> wrote:
Hi! Interesting idea, I appreciate your efforts. Having a single utility to manage the whole cluster seems meaningful, but I'm not sure. Speaking of PostgreSQL, in PostgreSQL, there are pg_ctl and initdb are separate utilities, and probably for a reason.

It’s just historical reasons. Starting PG9.0 onwards pg_ctl has init or initdb option as well.


Description of it - 
The init or initdb mode creates a new PostgreSQL database cluster. A database cluster is a collection of databases that are managed by a single server instance. This mode invokes the initdbcommand.


But anyway, curious to see how it will work! Will development be open source?

Yes. Would be great if can help review PRs and share your thoughts as we move forward on the journey.


Kalen Krempely

unread,
Jan 27, 2023, 6:00:42 PM1/27/23
to gpdb...@greenplum.org, Piyush Chandwadkar
1) My vote is for "gp" instead of "gpctl" to keep things short and easy to use.

2) The open source Command Line Interface Guidelines might be useful: https://clig.dev/


From: 'Piyush Chandwadkar' via Greenplum Developers <gpdb...@greenplum.org>
Sent: Thursday, January 26, 2023 2:07 AM
To: gpdb...@greenplum.org <gpdb...@greenplum.org>
Subject: CLI Design for managing Greenplum Cluster
 
!! External Email
!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Reply all
Reply to author
Forward
0 new messages