{
  "id": "create",
  "title": "crdb-cli crdb create",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/cli-utilities/crdb-cli/crdb/create/",
  "summary": "Creates an Active-Active database.",
  "content": "\nCreates an Active-Active database.\n\n```sh\ncrdb-cli crdb create --name \u003cname\u003e\n         --memory-size \u003cmaximum_memory\u003e\n         --instance fqdn=\u003ccluster1.example.com\u003e,username=\u003cusername\u003e,password=\u003cpassword\u003e[,url=https://\u003chostname-or-IP\u003e:9443,replication_endpoint=\u003chostname-or-IP\u003e:\u003cport\u003e,replication_tls_sni=\u003chostname\u003e]\n         --instance fqdn=\u003ccluster2.example.com\u003e,username=\u003cusername\u003e,password=\u003cpassword\u003e[,url=https://\u003chostname-or-IP\u003e:9443,replication_endpoint=\u003chostname-or-IP\u003e:\u003cport\u003e,replication_tls_sni=\u003chostname\u003e]\n         [--port \u003cport_number\u003e]\n         [--wait | --no-wait]\n         [--default-db-config \u003cconfiguration\u003e]\n         [--default-db-config-file \u003cfilename\u003e]\n         [--compression \u003c0-6\u003e]\n         [--causal-consistency { true | false } ]\n         [--password \u003cpassword\u003e]\n         [--replication { true | false } ]\n         [--encryption { true | false } ]\n         [--sharding { false | true } ]\n         [--shards-count \u003cnumber_of_shards\u003e]\n         [--shard-key-regex \u003cregex_rule\u003e]\n         [--oss-cluster { true | false } ]\n         [--oss-sharding { true | false } ]\n         [--bigstore { true | false }]\n         [--bigstore-ram-size \u003cmaximum_memory\u003e]\n         [--eviction-policy { noeviction | allkeys-lru | allkeys-lfu | allkeys-random | volatile-lru | volatile-lfu | volatile-random | volatile-ttl }]\n         [--proxy-policy { all-nodes | all-master-shards | single }]\n         [--with-module name=\u003cmodule_name\u003e,version=\u003cmodule_version\u003e,args=\u003cmodule_args\u003e]\n```\n\n### Prerequisites\n\nBefore you create an Active-Active database, you must have:\n\n- At least two participating clusters\n- [Network connectivity]() between the participating clusters\n\n### Parameters\n\n\n| Parameter\u0026nbsp;\u0026\u0026nbsp;options(s)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;                                                                             | Value                                           | Description                                                                                                                                                                                                                  |\n|---------------------------------------------------------------------------------------|-------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| name \\\u003cCRDB_name\\\u003e                                                                  | string                                          | Name of the Active-Active database (required)                                                                                                                                                                                |\n| memory-size \\\u003cmaximum_memory\\\u003e                                                                | size in bytes, kilobytes (KB), or gigabytes (GB) | Maximum database memory (required)                                                                                                                                                                                           |\n| instance fqdn=\\\u003ccluster_fqdn\\\u003e,username=\\\u003cusername\\\u003e,password=\\\u003cpassword\\\u003e,url=https://\\\u003chostname-or-IP\\\u003e:9443,replication_endpoint=\\\u003chostname-or-IP\\\u003e:\\\u003cport\\\u003e,replication_tls_sni=\\\u003chostname\\\u003e         | strings                                         | The connection information for the participating clusters (required for each participating cluster)\u003cbr/\u003e\u003cbr/\u003e**Required:**\u003cbr/\u003e• `fqdn` - Cluster fully qualified domain name\u003cbr/\u003e• `username` - Cluster username\u003cbr/\u003e• `password` - Cluster password\u003cbr/\u003e\u003cbr/\u003e**Optional:**\u003cbr/\u003e• `url` - URL to access the cluster's REST API\u003cbr/\u003e• `replication_endpoint` - Address to access the database instance for peer replication\u003cbr/\u003e• `replication_tls_sni` - Cluster [Server Name Indication (SNI)](https://en.wikipedia.org/wiki/Server_Name_Indication) hostname for TLS connections |\n| port \\\u003cport_number\\\u003e                                                                 | integer                                         | TCP port for the Active-Active database on all participating clusters                                                                                                                                                        |\n| default-db-config \\\u003cconfiguration\\\u003e                                                  | string                                          | Default database configuration options                                                                                                                                                                                       |\n| default-db-config-file \\\u003cfilename\\\u003e                                                  | filepath                                        | Default database configuration options from a file                                                                                                                                                                           |\n| wait                                                                               |                                                 | Prevents `crdb-cli` from running another command before this command finishes                                                                                                                                                  |\n| no-wait                                                                            |                                                 | `crdb-cli` can run another command before this command finishes                                                                                                                                 |\n| compression                                                                           | 0-6                                             | The level of data compression: \u003cbr /\u003e\u003cbr \u003e 0 = No compression \u003cbr /\u003e\u003cbr \u003e 6 = High compression and resource load (Default: 3)                                                                                                            |\n| causal-consistency                                                                    | true \u003cbr/\u003e false (*default*)                        | [Causal consistency]() applies updates to all instances in the order they were received                                                     |\n| password \\\u003cpassword\\\u003e                                                                | string                                          | Password for access to the database                                                                                                                                                                                          |\n| replication                                                                           | true \u003cbr/\u003e false (*default*)                        | Activates or deactivates [database replication]() where every master shard replicates to a replica shard                                                       |\n| encryption                                                                            | true \u003cbr/\u003e false (*default*)                        | Activates or deactivates encryption                                                                                                                                                                                          |\n| sharding                                                                              | true (*default*)\u003cbr/\u003e false                         | Activates or deactivates sharding (also known as [database clustering]()). Cannot be updated after the database is created                                   |\n| shards-count \\\u003cnumber_of_shards\\\u003e                                                              | integer                                         | If sharding is enabled, this specifies the number of Redis shards for each database instance                                                                                                                                 |\n| oss-cluster                                                                           | true\u003cbr/\u003efalse (*default*)                               | Activates [OSS cluster API]()                                                                                                                                |\n| shard-key-regex \\\u003cregex_rule\\\u003e                                                       | string                                          | If clustering is enabled, this defines a regex rule (also known as a [hashing policy]()) that determines which keys are located in each shard (defaults to `{u'regex': u'.*\\\\{(?\u003ctag\u003e.*)\\\\}.*'}, {u'regex': u'(?\u003ctag\u003e.*)'} `) |\n| bigstore                                                                              | true \u003cbr/\u003e \u003cbr/\u003e false (*default*)                        | If true, the database uses Auto Tiering to add flash memory to the database                                                                                                                                                |\n| bigstore-ram-size \\\u003csize\\\u003e                                                           | size in bytes, kilobytes (KB), or gigabytes (GB) | Maximum RAM limit for  databases with Auto Tiering enabled                                                                                                                                                                           |\n| with-module\u003cbr/\u003e\u0026nbsp;\u0026nbsp;name=\\\u003cmodule_name\\\u003e,\u003cbr/\u003e\u0026nbsp;\u0026nbsp;version=\\\u003cmodule_version\\\u003e,\u003cbr/\u003e\u0026nbsp;\u0026nbsp;args=\\\u003cmodule_args\\\u003e | strings                                         | Creates a database with a specific module                                                                                                                                                                                    |\n| eviction-policy                                                     | noeviction (*default*)\u003cbr/\u003eallkeys-lru\u003cbr/\u003eallkeys-lfu\u003cbr/\u003eallkeys-random\u003cbr/\u003evolatile-lru\u003cbr/\u003evolatile-lfu\u003cbr/\u003evolatile-random\u003cbr/\u003evolatile-ttl | Sets [eviction policy]()                                                                                                          |\n| proxy-policy                                                                          | all-nodes\u003cbr\u003eall-master-shards\u003cbr\u003esingle        | Sets proxy policy |\n\n\n\n### Returns\n\nReturns the task ID of the task that is creating the database.\n\nIf `--no-wait` is specified, the command exits. Otherwise, it will wait for the database to be created and then return the CRDB GUID.\n\n### Examples\n\n```sh\n$ crdb-cli crdb create --name database1 --memory-size 1GB --port 12000 \\\n           --instance fqdn=cluster1.redis.local,username=admin@redis.local,password=admin \\\n           --instance fqdn=cluster2.redis.local,username=admin@redis.local,password=admin\nTask 633aaea3-97ee-4bcb-af39-a9cb25d7d4da created\n  ---\u003e Status changed: queued -\u003e started\n  ---\u003e CRDB GUID Assigned: crdb:d84f6fe4-5bb7-49d2-a188-8900e09c6f66\n  ---\u003e Status changed: started -\u003e finished\n```\n\nTo create an Active-Active database with two shards in each instance and with encrypted traffic between the clusters:\n\n```sh\ncrdb-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\n```\n\nTo create an Active-Active database with two shards and with RediSearch 2.0.6 module:\n\n```sh\ncrdb-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\"\n```\n\nTo create an Active-Active database with two shards and with encrypted traffic between the clusters:\n\n```sh\ncrdb-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\n```\n\nTo create an Active-Active database with 1 shard in each instance and not wait for the response:\n\n```sh\ncrdb-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\n```\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

