> ## 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

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/admin_remove_ranks.rs#L36-L42)
pub async fn [admin\_remove\_ranks](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/admin-remove-ranks.md#method.admin_remove_ranks)( \&self, ranks: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AdminRemoveRanksResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Remove rank(s) from the Kinetica clusterRemove 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 rebalance\_sharded\_data or rebalance\_unsharded\_data parameters are set to false in the `options`, in which case the corresponding sharded data and/or unsharded data (a.k.a. randomly-sharded) will be deleted.The database must be offline for this operation, see `/admin/offline`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 `/create/job`.

##### Arguments

<ul>
  <li>`ranks` - 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 `/admin/switchover`). At least one worker rank must be left in the cluster after the operation.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/admin_remove_ranks.rs#L70-L86)
pub async fn [admin\_remove\_ranks\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/admin-remove-ranks.md#method.admin_remove_ranks_with_opts)( \&self, ranks: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, options: [AdminRemoveRanksRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AdminRemoveRanksResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Remove rank(s) from the Kinetica clusterRemove 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 rebalance\_sharded\_data or rebalance\_unsharded\_data parameters are set to false in the `options`, in which case the corresponding sharded data and/or unsharded data (a.k.a. randomly-sharded) will be deleted.The database must be offline for this operation, see `/admin/offline`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 `/create/job`.

##### Arguments

<ul>
  <li>`ranks` - 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 `/admin/switchover`). At least one worker rank must be left in the cluster after the operation.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/admin_remove_ranks.rs#L89-L100)
pub async fn [admin\_remove\_ranks\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/admin-remove-ranks.md#method.admin_remove_ranks_raw)( \&self, request: &[AdminRemoveRanksRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AdminRemoveRanksResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`AdminRemoveRanksRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksRequest) to the `/admin/remove/ranks` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/admin_remove_ranks.rs#L104-L116)
pub async fn [admin\_remove\_ranks\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/admin-remove-ranks.md#method.admin_remove_ranks_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[AdminRemoveRanksRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AdminRemoveRanksResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`AdminRemoveRanksRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.AdminRemoveRanksRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.