> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ocient.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ocient.ferndocs.com/_mcp/server.

# Ocient Simulator

> Discover how to use the Ocient simulator for testing and validating queries before deploying in production.

Ocient® provides a simulated database system upon request for development or local workloads with no performance requirements.

This simulator system is a lightweight package that emulates a complete Ocient System with these features:

* SQL port for connection using any of the supported connectors from Ocient.
* No NVMe drive or Linux® huge page requirements.

> **Note**
>
> To request access to an Ocient simulator, please contact Ocient Support.

# Prerequisites

The Ocient simulator has these hardware and software requirements:

**Hardware**

* 8GB system RAM
* 64-bit Intel® architecture CPU (x86)
* Allocated disk storage equal to twice the size of the data to load.

> **Note**
>
> If you run the Ocient Simulator on a virtual machine, you must configure your virtual machine CPU to support AVX2 instructions by setting the CPU type to `host`.

**Software**

Docker® [**Engine**](https://www.docker.com/get-started/) version 20.10.10 or greater with [**Docker Compose**](https://docs.docker.com/compose/) version 1.9.0 or greater.

If you do not have the minimum version of Docker Engine installed, you can use this workaround to run the Ocient Simulator with an older version.

Add the YAML option `security_opt: ["seccomp:unconfined"]` to the LAT service in the `docker-compose.yml` file in between the `image` and `hostname` keys.

```yaml
lat:
    image: "ocient/lat/simulator:3.0.2"
    security_opt: ["seccomp:unconfined"]
    hostname: "lat"
```

Add the command-line argument `--security-opt seccomp=unconfined` immediately after the `docker run` command in both `jdbc.sh` and `lat_client.sh` scripts.

```shell
exec docker run --security-opt seccomp=unconfined -it --rm -v $(pwd):/tmp/ocient -w /tmp/ocient --network "$network" ocient/jdbc:2.107
```

```shell
exec docker run --security-opt seccomp=unconfined $env_arg --rm -v $(pwd):/tmp/ocient -w /tmp/ocient --network "$network" ocient/lat_client:3.0.2 "$@"
```

# Install the Ocient Simulator

Ocient distributes its simulator as the tarball `simulator_archive.tar`. Upon receiving the file, you can extract it and load the container images into the Docker daemon with the provided `load_all_images.sh` file.

> **Note**
>
> Some file names might differ based on the simulator release version.

From a terminal window, create a new empty directory.

```shell
mkdir simulator_workspace
```

And then change the directory to the new one.

```shell
cd simulator_workspace
```

Copy or move the tarball file into the new directory.

Extract the file.

```shell
tar xf simulator_archive.tar
```

The simulator package contains these files.

| **File Name**                                                                             | **Description**                                                                                                                                             |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `configure.sql`                                                                           | The system configuration script that bootstraps the simulator.                                                                                              |
| `docker-compose.yml`                                                                      | The [**Docker Compose file**](https://docs.docker.com/compose/compose-application-model/) that defines the containers that constitute the simulator system. |
| `lat_client.tar`, `lat_simulator.tar`, `ocient_jdbc_image.tar`, `rolehostd_simulator.tar` | These Docker images comprise various components of the Ocient System.                                                                                       |
| `jdbc.sh`                                                                                 | The JDBC CLI launch script for connection to the SQL interface of the simulator.                                                                            |
| `lat_client.sh`                                                                           | The Loading and Transformation (LAT) client launch script for connection to the LAT of the simulator.                                                       |
| `load_all_images.sh`                                                                      | This script loads all the tarball files into the Docker daemon.                                                                                             |

Load the Ocient System tarball files that form the simulator.

```shell
./load_all_images.sh
```

> **Note**
>
> If you do not have access privileges to the Docker daemon, you might receive the `Permission denied` error when you run `docker` commands. Use `sudo` or add your user to the Docker group.

This output shows an example of a successful load operation. The exact output of your simulator might differ depending on what version you download.

```shell
a0c3d7b00a1e: Loading layer [=====================================>]  59.26MB/59.26MB
5d75db409355: Loading layer [=====================================>]  329.6MB/329.6MB
b4f0ab1562a2: Loading layer [=====================================>]  3.072kB/3.072kB
6b6be244d498: Loading layer [=====================================>]  94.76MB/94.76MB
Loaded image: ocient/lat/simulator:2.3.0
fb4617b63504: Loading layer [=====================================>]  29.39MB/29.39MB
f5745a52e122: Loading layer [=====================================>]  4.608kB/4.608kB
d2d33759728d: Loading layer [=====================================>]  12MB/12MB
f6533a5b289e: Loading layer [=====================================>]  10.24kB/10.24kB
a3f69486f426: Loading layer [=====================================>]  23.64MB/23.64MB
84ff92691f90: Loading layer [=====================================>]  10.24kB/10.24kB
Loaded image: ocient/lat_client:2.3.0
Loaded image: ocient/jdbc:2.100
475a54c2a93d: Loading layer [=====================================>]  65.52MB/65.52MB
314fd346d653: Loading layer [=====================================>]  1.32GB/1.32GB
Loaded image: ocient/rolehostd/simulator:23.0.0-1680124029
```

## Start and Configure the Cluster

Each Ocient simulator is a series of nodes that run in their own individual Docker containers. The `docker compose` command enables networking, general administration, and orchestration of these nodes.

> **Note**
>
> The commands you use based on this section might differ with your Docker version.
>
> These steps use the `docker compose` command for the simulator setup. If you are using an older version of Docker with `docker-compose` (a dash instead of a space), use that instead.

Start the cluster using the `docker compose` command.

```shell
docker compose up -d
```

The cluster startup displays output that is similar to this output.

```shell
[+] Running 7/7
 ⠿ Network simulator_workspace_ocientdbnet      Created                    0.1s
 ⠿ Container simulator_workspace-sql-1          Started                   20.2s
 ⠿ Container simulator_workspace-foundation0-1  Started                   15.4s
 ⠿ Container simulator_workspace-foundation2-1  Started                   17.4s
 ⠿ Container simulator_workspace-foundation1-1  Started                   16.4s
 ⠿ Container simulator_workspace-loader-1       Started                   14.4s
 ⠿ Container simulator_workspace-lat-1          Started                    7.1s
```

> **Note**
>
> Ensure that you run every command from the same directory where you extracted the `simulator_archive.tar.gz` archive.

Using the bundled JDBC CLI, connect to the cluster and run the contents of the `configure.sql` file that is distributed with the simulator.

The JDBC CLI is bundled with the simulator as the `jdbc.sh` script. Run this script with no arguments after starting the cluster.

```shell
./jdbc.sh
```

> **Note**
>
> After loading the JDBC CLI, the system prompts you to enter a username and password. The default simulator username and password are `admin@system` and `admin`.
>
> You can also pass these credentials later in a CONNECT statement, for example:
>
> `CONNECT TO jdbc:ocient://sql:4050/system USER admin@system USING admin;`

The interface switches to the JDBC CLI interactive mode, as indicated by the `Ocient>` prompt. Run the configuration file.

**`JDBC CLI`**

```shell title="JDBC CLI"
source configure.sql;
```

The configuration displays output that is similar to this output.

```shell
Connected to jdbc:ocient://sql:4050/system
Modified 0 rows
Modified 0 rows
Modified 0 rows
Warning: Node must be restarted for changes to take effect (the streamloader role has been added to the configuration, but the streamloader is not yet active on the node. To have this change take effect, a restart of the streamloader and foundation nodes is required)
Modified 0 rows
Modified 0 rows
Modified 0 rows
```

After completing its modifications, the simulator warns that it needs to restart for the changes to take effect. Quit the interactive mode.

**`JDBC CLI`**

```shell title="JDBC CLI"
quit
```

Restart the cluster.

```shell
docker compose restart
```

After the nodes restart, verify that the simulator has started and the `test` database is accessible by connecting to it with the JDBC CLI.

Launch the JDBC connector again.

```shell
./jdbc.sh
```

Connect to the `test` database in the JDBC CLI.

**`JDBC CLI`**

```shell title="JDBC CLI"
CONNECT TO jdbc:ocient://sql:4050/test;
```

The system displays a message to confirm a successful connection.

**`JDBC CLI`**

```shell title="JDBC CLI"
Connected to jdbc:ocient://sql:4050/test
```

## Load Data with the LAT Client

The simulator cluster includes an LAT Node, which can load data from external sources, such as an Amazon® Web Services℠ (AWS℠) S3 bucket. This section has the steps to create a basic table and pipeline with the LAT client, which you can then use to load data from a sample data set into a simulator database.

If you are not already in the JDBC CLI interactive mode, start it and connect to the `test` database using the steps in [**Start and Configure the Cluster**](#start-and-configure-the-cluster).

Create a table to load. From the JDBC CLI, enter this SQL `CREATE TABLE` statement.

```sql
CREATE TABLE loading.data_type_coverage (
  col_bigint BIGINT NULL,
  col_binary BINARY(2) NULL,
  col_boolean BOOL NULL,
  col_char CHAR(4) NULL,
  col_date DATE NULL,
  col_decimal DECIMAL(18,4) NULL,
  col_double DOUBLE NULL,
  col_float FLOAT NULL,
  col_int INT NULL,
  col_int_array INT[] NULL,
  col_ipv4 IPV4 NULL,
  col_ip IP NULL,
  col_smallint SMALLINT NULL,
  col_point POINT NULL,
  col_linestring LINESTRING NULL,
  col_polygon POLYGON NULL,
  col_time TIME NULL,
  col_timestamp TIMESTAMP NULL,
  col_tinyint TINYINT NULL,
  col_tuple tuple<<INT, VARCHAR(255)>> NULL,
  col_uuid UUID NULL,
  col_varbinary VARBINARY(255) NULL,
  col_varchar VARCHAR(255) NULL
);
```

Create a pipeline to load the data using the LAT client. Exit the JDBC CLI by entering the `quit` command.

Create a new file named `pipeline.json` in the directory where you are running the simulator.

Copy this JSON text and paste it into the `pipeline.json` file.

```json
{
    "version": 2,
    "workers": 1,
    "source": {
        "compression": "gzip",
        "type": "s3",
		"endpoint": "https://s3.us-east-1.amazonaws.com",
		"bucket": "ocient-examples",
		"file_groups": {
			"test": {
				"prefix": "all_data_types/small",
				"file_matcher_syntax": "glob",
				"file_matcher_pattern": "**output*.csv.gz",
				"sort_type": "lexicographic"
			}
        }
    },
    "sink": {
        "type": "ocient",
        "remotes": ["loader:5050"]
    },
    "extract": {
        "test": {
            "record_type": "delimited",
            "headers": [
                "bigint",
                "binary",
                "boolean",
                "char",
                "date",
                "decimal",
                "double",
                "float",
                "int",
                "int_array",
                "ipv4",
                "ip",
                "smallint",
                "point",
                "linestring",
                "polygon",
                "time",
                "timestamp",
                "tinyint",
                "tuple",
                "uuid",
                "varbinary",
                "varchar"
            ],
            "record_delimiter": "\n",
            "field_delimiter": ",",
            "field_optionally_enclosed_by": "\"",
            "num_header_lines": 1
        }
    },
    "transform": {
        "file_groups": {
            "test": {
                "tables": {
                    "test.loading.data_type_coverage": {
                        "columns": {
                            "col_bigint": "bigint",
                            "col_binary": "binary",
                            "col_boolean": "boolean",
                            "col_char": "char",
                            "col_date": "date",
                            "col_decimal": "decimal",
                            "col_double": "to_number(double)",
                            "col_float": "to_number(float)",
                            "col_int": "int",
                            "col_int_array": "parse_array(int_array, '[', ',', `1`)",
                            "col_ipv4": "ipv4",
                            "col_ip": "ip",
                            "col_smallint": "smallint",
                            "col_point": "point",
                            "col_linestring": "linestring",
                            "col_polygon": "polygon",
                            "col_time": "time",
                            "col_timestamp": "replace(replace(timestamp, 'T', ' '), 'Z', '')",
                            "col_tinyint": "tinyint",
                            "col_tuple": "to_tuple(tuple, '(', ',')",
                            "col_uuid": "uuid",
                            "col_varbinary": "varbinary",
                            "col_varchar": "varchar"
                        }
                    }
                }
            }
        }
    }
}
```

Execute this command to create the pipeline by using the LAT client script.

```shell
./lat_client.sh pipeline create --pipeline pipeline.json
```

> **Note**
>
> Unlike the JDBC CLI, the LAT client is not interactive. You must issue each command for the LAT client as a separate `./lat_client` command.

Start the pipeline to load the data.

```shell
./lat_client.sh pipeline start
```

The sample data set can take about 30 seconds to fully load.

Inspect the tables using the JDBC CLI to validate the load of the data set. Launch the JDBC CLI.

```shell
./jdbc.sh
```

Connect to the `test` database.

**`JDBC CLI`**

```shell title="JDBC CLI"
CONNECT TO jdbc:ocient://sql:4050/test;
```

Verify the `loading.data_type_coverage` table is present.

**`JDBC CLI`**

```shell title="JDBC CLI"
LIST TABLES;
```

Verify the row count in the table using this SQL statement.

```sql
SELECT COUNT(*) FROM loading.data_type_coverage;
```

If the load operation is complete, the output table shows a count of 100,000 rows.

```sql
count(*)
--------------------
100000

Fetched 1 row
```

When you are confident your data is fully loaded, you can dismantle your pipeline.

Stop the pipeline.

```shell
./lat_client.sh pipeline stop
```

Delete the pipeline.

```shell
./lat_client.sh pipeline delete
```

Now that your Ocient simulator is loaded with data, you can add integrations for user interfaces, visualizations, and other applications. For details, see [**Ocient Integrations**](/guides/connect-to-ocient/ocient-integrations).

# Container Configuration

This section explains the configuration setup and options for the Ocient simulator.

## Ports

The container exposes additional ports that can be useful depending on the use case for the system.

| **Exposed Port** | **Description**                                                                    |
| ---------------- | ---------------------------------------------------------------------------------- |
| 4050             | The JDBC port of the cluster.                                                      |
| 8080             | Ocient LAT service. When you load new data, the LAT client connects to this port.  |
| 9090 and 9091    | The REST interfaces for the SQL and Foundation (LTS) Node processes, respectively. |

## Environment Variables

You can set these environment variables to affect certain aspects of the Ocient simulator.

| **Environment variable**         | **Description**                                                                                                                                                                                                                                                             |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LAT_MEMORY and LAT_MEMORY_DIRECT | Configures the memory used by LAT when it is running. For details about these environment variables, see the [**LAT Service Configuration**](/guides/lat-reference/lat-service-configuration) page. The LAT Node is the only node in the cluster affected by this variable. |

**Example**

```yaml
services:
  lat:
    environment:
      LAT_MEMORY: '32G'
```

## Resource Limits (CPU, Memory, Disk Usage)

Docker supports a variety of options to limit container access to host resources. Refer to the Docker [**Runtime options with Memory, CPUs, and GPUs**](https://docs.docker.com/config/containers/resource_constraints/) page for the full list of options. This section explains how constraints on specific host resources affect the Ocient simulator.

> **Note**
>
> In all of these code examples, replace `IMAGE` with the filename of your Docker image.

> **Note**
>
> The Ocient System applies Docker resource configuration changes individually on each of the nodes in the `docker-compose.yml` file (such as `sql`, `foundation`, `loader`, `lat`).

### CPU

CPU can be safely limited without adverse effects. Most workloads benefit from having multiple CPU cores available (four or more).

For example, to add CPU limits to the `sql` node, add this text to the `docker-compose.yml` file in the simulator package. Replace the `'4'` with the CPU limit that you want.

```yaml
services:
  sql:
    image: IMAGE
    deploy:
      resources:
        limits:
          cpus: '4'
```

### Memory (RAM)

The Ocient simulator requires sufficient RAM to execute all workloads. Stability or uptime of the system is not guaranteed in low or out-of-memory conditions. If you need to limit the memory of the running Docker container, it is recommended to benchmark the container memory usage on your workload and provide at least 1GB of RAM above the maximum observed.

> **Warning**
>
> When limiting memory of the Ocient Simulator, do not use the `--oom-kill-disable` option, otherwise the database can become unresponsive for a significant period of time after running out of memory.

To add memory limits to the `sql` node, add this text to the `docker-compose.yml` file in the simulator package. Replace the `8g` with the memory limit that you want.

```yaml
services:
  sql:
    image: IMAGE
    deploy:
      resources:
        limits:
          memory: 8g
```

### Disk Usage

When running the simulator without mounted data, you can specify the size in bytes of the data files created. The data files must be large enough to fit any data sets that you load. The file size defaults to 2GiB.

To specify a different file size, you can configure the rolehostd startup command in the `docker-compose.yml` file. Add the command option `loopbackDeviceSize` with a new value to configure a new file size.

In this example, the file size on the `foundation0` node is configured to 16GiB.

```yaml
services:
  sql:
    image: IMAGE
    command: "--bootstrap '{adminHost: \"sql\", ipAddress: \"foundation0\", loopbackDeviceSize: \"16GiB\"}}'"
```

If you want to specify a new file size value, you must do it before you create your cluster.

While you cannot resize files on a running cluster, you can change this value by deleting and recreating your cluster. This process is irreversible and erases any existing databases and tables.

To resize file on an existing cluster:

1. Stop your cluster by running `docker compose down`.
2. Clear the `volumes` directory by running `rm -rf volumes/`.
3. If you have not yet edited the `docker-compose.yml` file, edit the file to include new `loopbackDeviceSize` values.
4. Restart your cluster by running `docker compose up -d`.

## Simulator Logging

The Ocient simulator sends all logs to stdout and stderr as well as any logging driver configured for the host Docker installation or the container. This logging allows for easy inspection of container logs using the [`docker logs`](https://docs.docker.com/engine/reference/commandline/logs/) command.

For details on logging with Docker, consult the [**logging section**](https://docs.docker.com/compose/compose-file/compose-file-v2/#logging) in the Docker documentation.

### Setting Logging Levels

You can modify the logging level for each node in the cluster by configuring the `rolehostd` startup command in the `docker-compose.yml` file. Add the command option `logLevel` with a new log level.

Supported values include `error`, `info`, `warn`, `verbose`, or `debug`. Defaults to `info`.

For details, see [**Log Monitoring**](/guides/system-administration/monitoring/log-monitoring).

**Example**

```yaml
services:
  sql:
    image: IMAGE
    command: "--bootstrap '{adminHost: \"sql\", ipAddress: \"foundation0\", logLevel: \"debug\"}}'"
```

### Other Logging Configurations

You can customize your logging configuration for each node by making changes to the `docker-compose.yml` file. In this example, the `sql` node has special configurations for its `max-size` and `max-file` values, meaning the container should have no more than five log files of 10MB in size.

**Example**

```yaml
services:
  sql:
    image: IMAGE
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: 5
```

Use `docker logs` to retrieve the logs. In this example, the `--tail` option limits the output to include only the last 10 lines of logs.

For more options, see the [**docker compose logs**](https://docs.docker.com/engine/reference/commandline/compose_logs/) page.

```shell
docker logs --tail 10 CONTAINER
```

## Related Links

[**Commands Supported by the Ocient JDBC CLI Program**](/guides/connection-driver-reference/jdbc-manual/commands-supported-by-the-ocient-jdbc-cli-program)

[**CREATE TABLE**](/guides/sql-reference/data-definition-language-ddl-statement-reference/tables)

---

\*\*Linux®*is the registered trademark of Linus Torvalds in the U.S. and other countries.*