GPINITSYSTEM Error: "Number of Separate Hosts must be Greater than the Number of Segment Instances per Host"
search cancel

GPINITSYSTEM Error: "Number of Separate Hosts must be Greater than the Number of Segment Instances per Host"

book

Article ID: 295506

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Symptoms:

Attempting to initialize the cluster using gpinitsystem with option -S returns the following error message:

20140603:06:08:45:006838 gpinitsystem:etl5-r1-master01:gpadmin-[INFO]:-Configuring build for multi-home array
20140603:06:08:45:006838 gpinitsystem:etl5-r1-master01:gpadmin-[FATAL]:-Request made for spread mirroring via -S option, but insufficient hosts available
20140603:06:08:45:006838 gpinitsystem:etl5-r1-master01:gpadmin-[INFO]:-Number of separate hosts must be greater than number of segment instances per host
20140603:06:08:45:006838 gpinitsystem:etl5-r1-master01:gpadmin-[INFO]:-Start Function ERROR_EXIT
20140603:06:08:45:gpinitsystem:etl5-r1-master01:gpadmin-[FATAL]:-Unable to continue Script Exiting

Environment


Cause

As per the guide, the option "-S" stands for:

If mirroring parameters are specified, spreads the mirror segments across the available hosts. The default is to group the set of mirror segments together on an alternate host from their primary segment set. Mirror spreading will place each mirror on a different host within the Greenplum Database array. Spreading is only allowed if there is a sufficient number of hosts in the array (number of hosts is greater than the number of segment instances).

  • Let's put it in practice with an example. I have the below set of 7 hosts with 2 Nics:
    sdw1-1
    sdw1-2
    sdw2-1
    sdw2-2
    sdw3-1
    sdw3-2
    sdw4-1
    sdw4-2
    sdw5-1
    sdw5-2
    sdw6-1
    sdw6-2
    sdw7-1
    sdw7-2
  • Now, when you have a primary created on SDW1 (for eg. 6 primaries), it will be distributed between 2 the Nics like this:
    [INFO]:-sdw1-1 /data1/primary_1/yogpseg0 27980 2 0 31500
    [INFO]:-sdw1-1 /data1/primary_1/yogpseg1 27981 3 1 31501
    [INFO]:-sdw1-1 /data1/primary_1/yogpseg2 27982 4 2 31502
    [INFO]:-sdw1-2 /data2/primary_1/yogpseg3 27983 5 3 31503
    [INFO]:-sdw1-2 /data2/primary_1/yogpseg4 27984 6 4 31504
    [INFO]:-sdw1-2 /data2/primary_1/yogpseg5 27985 7 5 31505
  • But with the -S option, which means spreading the mirrors between the host and the mirror for a single server content (for eg. SDW1) which should not be on the same host. This distribution would look like:
    [INFO]:-sdw2-2 /data1/mirror/yogpseg0 10400 44 0 41600
    [INFO]:-sdw3-2 /data1/mirror/yogpseg1 10401 45 1 41601
    [INFO]:-sdw4-2 /data1/mirror/yogpseg2 10402 46 2 41602
    [INFO]:-sdw5-1 /data2/mirror/yogpseg3 10403 47 3 41603
    [INFO]:-sdw6-1 /data2/mirror/yogpseg4 10404 48 4 41604
    [INFO]:-sdw7-1 /data2/mirror/yogpseg5 10405 49 5 41605

So in any case, if you don't have enough segment servers to spread the mirrors, you would encounter the above-mentioned error.

 

Resolution

To avoid this issue, follow these steps:

  1. Remove -S option with gpinitsystem.
  2. Add more hosts (Number of primaries + 1) to overcome the problem.