> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# admin_remove_ranks

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.admin_remove_ranks"> <span className="sig-name descname"><span className="pre">admin\_remove\_ranks</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">ranks</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L14990"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Remove one or more ranks from an existing Kinetica cluster. All data will be rebalanced to other ranks before the rank(s) is removed unless the <span className="em">rebalance\_sharded\_data</span> or <span className="em">rebalance\_unsharded\_data</span> parameters are set to <span className="em">false</span> in the input parameter <span className="em">options</span>, in which case the corresponding <a className="reference external" href="/content/concepts/tables/#sharding">sharded data</a> and/or unsharded data (a.k.a. <a className="reference external" href="/content/concepts/tables/#random-sharding">randomly-sharded</a>) will be deleted.</p>
      <p>The database must be offline for this operation, see <a className="reference internal" href="#gpudb.GPUdb.admin_offline" title="gpudb.GPUdb.admin_offline"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.admin\_offline()</span></code></a></p>
      <p>This endpoint’s processing time depends on the amount of data in the system, thus the API call may time out if run directly. It is recommended to run this endpoint asynchronously via <a className="reference internal" href="#gpudb.GPUdb.create_job" title="gpudb.GPUdb.create_job"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.create\_job()</span></code></a>.</p>

      <div className="admonition note">
        <p className="admonition-title">Note</p>
        <p>This method should be used for on-premise deployments only.</p>
      </div>

      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">ranks (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>Each array value designates one or more ranks to remove from the cluster. Values can be formatted as ‘rankN’ for a specific rank, ‘hostN’ (from the gpudb.conf file) to remove all ranks on that host, or the host IP address (hostN.address from the gpub.conf file) which also removes all ranks on that host. Rank 0 (the head rank) cannot be removed (but can be moved to another host using <a className="reference internal" href="#gpudb.GPUdb.admin_switchover" title="gpudb.GPUdb.admin_switchover"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.admin\_switchover()</span></code></a>). At least one worker rank must be left in the cluster after the operation. The user can provide a single element (which will be automatically promoted to a list internally) or a list.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>rebalance\_sharded\_data</strong> – If <span className="em">true</span>, <a className="reference external" href="/content/concepts/tables/#sharding">sharded data</a> will be rebalanced approximately equally across the cluster. Note that for clusters with large amounts of sharded data, this data transfer could be time consuming and result in delayed query responses. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘true’.</p>
                </li>

                <li>
                  <p><strong>rebalance\_unsharded\_data</strong> – If <span className="em">true</span>, unsharded data (a.k.a. <a className="reference external" href="/content/concepts/tables/#random-sharding">randomly-sharded</a>) will be rebalanced approximately equally across the cluster. Note that for clusters with large amounts of unsharded data, this data transfer could be time consuming and result in delayed query responses. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘true’.</p>
                </li>

                <li>
                  <p><strong>aggressiveness</strong> – Influences how much data is moved at a time during rebalance. A higher <span className="em">aggressiveness</span> will complete the rebalance faster. A lower <span className="em">aggressiveness</span> will take longer but allow for better interleaving between the rebalance and other queries. Valid values are constants from 1 (lowest) to 10 (highest). The default value is ‘10’.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl simple">
            <div className="dt">removed\_ranks (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>The number assigned to each rank removed from the cluster. This array will be empty if the operation fails.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
