--- Title: crdb-cli crdb create alwaysopen: false categories: - docs - operate - rs description: Creates an Active-Active database. linkTitle: create weight: $weight url: '/operate/rs/7.8/references/cli-utilities/crdb-cli/crdb/create/' --- Creates an Active-Active database. ```sh crdb-cli crdb create --name --memory-size --instance fqdn=,username=,password=[,url=https://:9443,replication_endpoint=:,replication_tls_sni=] --instance fqdn=,username=,password=[,url=https://:9443,replication_endpoint=:,replication_tls_sni=] [--port ] [--wait | --no-wait] [--default-db-config ] [--default-db-config-file ] [--compression <0-6>] [--causal-consistency { true | false } ] [--password ] [--replication { true | false } ] [--encryption { true | false } ] [--sharding { false | true } ] [--shards-count ] [--shard-key-regex ] [--oss-cluster { true | false } ] [--oss-sharding { true | false } ] [--bigstore { true | false }] [--bigstore-ram-size ] [--eviction-policy { noeviction | allkeys-lru | allkeys-lfu | allkeys-random | volatile-lru | volatile-lfu | volatile-random | volatile-ttl }] [--proxy-policy { all-nodes | all-master-shards | single }] [--with-module name=,version=,args=] ``` ### Prerequisites Before you create an Active-Active database, you must have: - At least two participating clusters - [Network connectivity]({{< relref "/operate/rs/7.8/networking/port-configurations" >}}) between the participating clusters ### Parameters | Parameter & options(s)           | Value | Description | |---------------------------------------------------------------------------------------|-------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | name \ | string | Name of the Active-Active database (required) | | memory-size \ | size in bytes, kilobytes (KB), or gigabytes (GB) | Maximum database memory (required) | | instance fqdn=\,username=\,password=\,url=https://\:9443,replication_endpoint=\:\,replication_tls_sni=\ | strings | The connection information for the participating clusters (required for each participating cluster)

**Required:**
• `fqdn` - Cluster fully qualified domain name
• `username` - Cluster username
• `password` - Cluster password

**Optional:**
• `url` - URL to access the cluster's REST API
• `replication_endpoint` - Address to access the database instance for peer replication
• `replication_tls_sni` - Cluster [Server Name Indication (SNI)](https://en.wikipedia.org/wiki/Server_Name_Indication) hostname for TLS connections | | port \ | integer | TCP port for the Active-Active database on all participating clusters | | default-db-config \ | string | Default database configuration options | | default-db-config-file \ | filepath | Default database configuration options from a file | | wait | | Prevents `crdb-cli` from running another command before this command finishes | | no-wait | | `crdb-cli` can run another command before this command finishes | | compression | 0-6 | The level of data compression:

0 = No compression

6 = High compression and resource load (Default: 3) | | causal-consistency | true
false (*default*) | [Causal consistency]({{< relref "/operate/rs/7.8/databases/active-active/causal-consistency.md" >}}) applies updates to all instances in the order they were received | | password \ | string | Password for access to the database | | replication | true
false (*default*) | Activates or deactivates [database replication]({{< relref "/operate/rs/7.8/databases/durability-ha/replication.md" >}}) where every master shard replicates to a replica shard | | encryption | true
false (*default*) | Activates or deactivates encryption | | sharding | true (*default*)
false | Activates or deactivates sharding (also known as [database clustering]({{< relref "/operate/rs/7.8/databases/durability-ha/clustering.md" >}})). Cannot be updated after the database is created | | shards-count \ | integer | If sharding is enabled, this specifies the number of Redis shards for each database instance | | oss-cluster | true
false (*default*) | Activates [OSS cluster API]({{< relref "/operate/rs/7.8/clusters/optimize/oss-cluster-api" >}}) | | shard-key-regex \ | string | If clustering is enabled, this defines a regex rule (also known as a [hashing policy]({{< relref "/operate/rs/7.8/databases/durability-ha/clustering#custom-hashing-policy" >}})) that determines which keys are located in each shard (defaults to `{u'regex': u'.*\\{(?.*)\\}.*'}, {u'regex': u'(?.*)'} `) | | bigstore | true

false (*default*) | If true, the database uses Auto Tiering to add flash memory to the database | | bigstore-ram-size \ | size in bytes, kilobytes (KB), or gigabytes (GB) | Maximum RAM limit for databases with Auto Tiering enabled | | with-module
  name=\,
  version=\,
  args=\ | strings | Creates a database with a specific module | | eviction-policy | noeviction (*default*)
allkeys-lru
allkeys-lfu
allkeys-random
volatile-lru
volatile-lfu
volatile-random
volatile-ttl | Sets [eviction policy]({{< relref "/operate/rs/7.8/databases/memory-performance/eviction-policy" >}}) | | proxy-policy | all-nodes
all-master-shards
single | Sets proxy policy | ### Returns Returns the task ID of the task that is creating the database. If `--no-wait` is specified, the command exits. Otherwise, it will wait for the database to be created and then return the CRDB GUID. ### Examples ```sh $ crdb-cli crdb create --name database1 --memory-size 1GB --port 12000 \ --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin \ --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin Task 633aaea3-97ee-4bcb-af39-a9cb25d7d4da created ---> Status changed: queued -> started ---> CRDB GUID Assigned: crdb:d84f6fe4-5bb7-49d2-a188-8900e09c6f66 ---> Status changed: started -> finished ``` To create an Active-Active database with two shards in each instance and with encrypted traffic between the clusters: ```sh crdb-cli crdb create --name mycrdb --memory-size 100mb --port 12000 --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin --shards-count 2 --encryption true ``` To create an Active-Active database with two shards and with RediSearch 2.0.6 module: ```sh crdb-cli crdb create --name mycrdb --memory-size 100mb --port 12000 --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin --shards-count 2 --with-module name=search,version="2.0.6",args="PARTITIONS AUTO" ``` To create an Active-Active database with two shards and with encrypted traffic between the clusters: ```sh crdb-cli crdb create --name mycrdb --memory-size 100mb --port 12000 --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin --encryption true --shards-count 2 ``` To create an Active-Active database with 1 shard in each instance and not wait for the response: ```sh crdb-cli crdb create --name mycrdb --memory-size 100mb --port 12000 --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin --no-wait ```