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

# Ocient Application Configuration

export const Ocient = "Ocient®";

These steps assume that you have already completed the process for bootstrapping your {Ocient} System nodes. If you have not done this yet, perform the [Ocient System Bootstrapping](/ocient-system-bootstrapping) steps before beginning this configuration process.

Now that the nodes have all completed bootstrapping, you must properly configure the nodes to perform their roles. You should run these commands using a SQL connection to one of the SQL Nodes in your system. For details, see [Connect to Ocient](/connect-to-ocient).

The Ocient application configuration process consists of these steps:

1. [Creating a Storage Space](#creating-a-storage-space)
2. [Creating Storage Clusters](#creating-storage-clusters)
3. [Assigning Service Roles](#assigning-service-roles)
4. [Restart the Nodes](#restart-the-nodes)

<Steps>
  <Step title="Creating a Storage Space">
    To create a storage space with 12 segments, use `WIDTH=12` and `PARITY_WIDTH=2`. Two of these segments are the parity portion, and 10 of these segments are the data portion.

    ```sql SQL theme={null}
    CREATE STORAGESPACE teststoragespace WIDTH = 12, PARITY_WIDTH = 2;
    ```

    <Info>
      The storage space name must begin with a letter followed by letters, numbers, and underscores.
    </Info>

    You can view all storage spaces in the system by querying the `sys.storage_spaces` system catalog table.

    ```sql SQL theme={null}
    SELECT * FROM sys.storage_spaces;
    ```

    For details about creating a storage space to suit your system needs, see [Configure Storage Spaces](/configure-storage-spaces).
  </Step>

  <Step title="Creating Storage Clusters">
    You must have at least one storage cluster to configure an Ocient System. A storage cluster is a set of Foundation Nodes with an associated storage space that coordinate to reliably store data and serve queries.

    Create a Foundation cluster.

    ```sql SQL theme={null}
    CREATE CLUSTER lts_cluster
    TYPE LTS storagespace "teststoragespace"
    PARTICIPANTS=('lts0','lts1','lts2','lts3','lts4','lts5','lts6','lts7','lts8','lts9','lts10','lts11');
    ```

    <Info>
      Loader Nodes and SQL Nodes do not need to be placed into a cluster.
    </Info>

    <Info>
      At a minimum, the number of participants must be the width specified in the storage space. This number can be greater if you overprovision the system. For details about storage spaces and related settings, overprovisioning, and parity, see [Core Elements of an Ocient System](/core-elements-of-an-ocient-system#segments-and-segment-groups).
    </Info>

    View all clusters in the system.

    ```sql SQL theme={null}
    SELECT * FROM sys.clusters;
    ```

    View all clusters and their associated nodes.

    ```sql SQL theme={null}
    SELECT c.name AS cluster_name, c.cluster_type, n.name AS node_name
    FROM sys.node_clusters nc
    JOIN sys.clusters c ON nc.cluster_id = c.id
    JOIN sys.nodes n ON nc.node_id = n.id;
    ```

    <Warning>
      You must restart all nodes with the SQL role after adding a storage cluster.
    </Warning>
  </Step>

  <Step title="Assigning Service Roles">
    Assign service roles to each accepted node. This process defines how each node participates in queries and the management of the system.

    View all nodes and their configured roles.

    ```sql SQL theme={null}
    SELECT n.name AS node_name, sr.service_role_type
    FROM sys.nodes n
    LEFT JOIN sys.service_roles sr ON sr.node_id = n.id;
    ```

    The addition of nodes to the storage cluster in the prior step automatically assigns `lts` to the Foundation Nodes that you included.

    Add the remaining `sql`, `admin`, and `streamloader` roles to the appropriate nodes.

    ```sql SQL theme={null}
    ALTER NODE "sql1" ADD ROLE sql;
    ALTER NODE "sql1" ADD ROLE admin;
    ALTER NODE "loader1" ADD ROLE streamloader;
    ```

    <Info>
      The `Admin` role can operate standalone or on the same node as the `SQL` role.
    </Info>
  </Step>

  <Step title="Restart the Nodes">
    With roles assigned to the nodes, you can restart the `rolehostd` process on all nodes. At a shell terminal on each node, run this command.

    ```shell Shell theme={null}
    sudo systemctl restart rolehostd
    ```

    <Info>
      If any custom configuration settings are applied to running nodes during other configurations, be sure to restart the `rolehostd` process before proceeding.
    </Info>

    You can check the status of nodes using the Status endpoint on each node from a terminal. Assuming IP Addresses `10.10.0.2` and `10.10.0.3` for `sql1` and `lts0`, respectively, you can check the status with these curl commands.

    ```curl CURL theme={null}
    curl http://10.10.0.2:9090/v1/status
    curl http://10.10.0.3:9090/v1/status
    ```

    After all of the nodes are `Active`, Ocient is ready to use for queries.
  </Step>
</Steps>

## Creating an Ocient System with Multiple Storage Clusters

If you need an Ocient System that requires 10 or more Foundation Nodes in the storage cluster, then you can create multiple storage clusters. For considerations to take into account when you work with multiple storage clusters, see [Multiple Storage Clusters for Loading Data](/multiple-storage-clusters-for-loading-data).

Create a multiple storage cluster with 12 nodes. Create a storage space `store` with width `5` and parity width `1` using the `CREATE STORAGESPACE` SQL statement.

```sql SQL theme={null}
CREATE STORAGESPACE store WIDTH = 5, PARITY_WIDTH = 1;
```

Create multiple clusters using the `CREATE CLUSTER` SQL statements using the storage space `store`. Split the Foundation Nodes among the clusters. `cluster_0` storage cluster has Foundation Nodes `lts0` through `lts5`, while `cluster_1` has `lts6` through `lts11`.

```sql SQL theme={null}
CREATE CLUSTER cluster_0 TYPE=lts PARTICIPANTS=("lts0", "lts1", "lts2", "lts3", "lts4", "lts5") STORAGESPACE=store;

CREATE CLUSTER cluster_1 TYPE=lts PARTICIPANTS=("lts6", "lts7", "lts8", "lts9", "lts10", "lts11") STORAGESPACE=store;
```

## Validating the System After Configuration

After configuration, you can run a system check to validate the Ocient installation and bootstrapping. For details, see [Checking System After Configuration](/checking-system-after-configuration).

## Next Step

Follow the process in [Ingest Data with Legacy LAT Reference](/ingest-data-with-legacy-lat-reference) to create a database and a table, then load data from a set of files located on a cloud object storage.

## Related Links

[Installation Reference](/installation-reference)

[Install an Ocient System](/install-an-ocient-system)
