Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions modules/develop/pages/config-topics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ Creating a topic can be as simple as specifying a name for your topic on the com
rpk topic create xyz
----

This command creates a topic named `xyz` with one partition and one replica, because these are the default values set in the cluster configuration file.
ifndef::env-cloud[]
This command creates a topic named `xyz` with one partition and one replica, because these are the default values set in the cluster configuration file. Replicas are copies of partitions that are distributed across different brokers, so if one broker goes down, other brokers still have a copy of the data.

endif::[]

ifdef::env-cloud[]
This command creates a topic named `xyz` with one partition and three replicas, because these are the default values set in the cluster configuration file. Replicas are copies of partitions that are distributed across different brokers, so if one broker goes down, other brokers still have a copy of the data.

endif::[]

This section shows how to change default settings for a topic.

Expand All @@ -35,9 +43,7 @@ rpk topic create xyz -p 10
ifndef::env-cloud[]
=== Choose the replication factor

Replicas are copies of partitions that are distributed across different brokers, so if one broker goes down, other brokers still have a copy of the data. The default replication factor in the cluster configuration is set to 1.

By choosing a replication factor greater than 1, you ensure that each partition has a copy of its data on at least one other broker. One replica acts as the leader, and the other replicas are followers.
The default replication factor in the cluster configuration is set to 1. By choosing a replication factor greater than 1, you ensure that each partition has a copy of its data on at least one other broker. One replica acts as the leader, and the other replicas are followers.

To specify a replication factor of 3 for topic `xyz`, run:

Expand Down Expand Up @@ -158,6 +164,7 @@ The `-c` flag limits the command output to just the topic configurations. This c

The following command output displays after running `rpk topic describe test-topic`, where `test-topic` was created with default settings:

ifndef::env-cloud[]
[,bash]
----
rpk topic describe test_topic
Expand Down Expand Up @@ -196,6 +203,38 @@ PARTITIONS 3
REPLICAS 3
----

endif::[]

ifdef::env-cloud[]
[,bash]
----
rpk topic describe test_topic
SUMMARY
=======
NAME test_topic
PARTITIONS 1
REPLICAS 3

CONFIGS
=======
KEY VALUE SOURCE
cleanup.policy delete DYNAMIC_TOPIC_CONFIG
compression.type producer DEFAULT_CONFIG
max.message.bytes 1048576 DEFAULT_CONFIG
message.timestamp.type CreateTime DEFAULT_CONFIG
redpanda.datapolicy function_name: script_name: DEFAULT_CONFIG
redpanda.remote.delete true DEFAULT_CONFIG
redpanda.remote.read false DEFAULT_CONFIG
redpanda.remote.write false DEFAULT_CONFIG
retention.bytes -1 DEFAULT_CONFIG
retention.local.target.bytes -1 DEFAULT_CONFIG
retention.local.target.ms 86400000 DEFAULT_CONFIG
retention.ms 604800000 DEFAULT_CONFIG
segment.bytes 1073741824 DEFAULT_CONFIG
----

endif::[]

== Delete a topic

To delete a topic, run:
Expand Down
2 changes: 2 additions & 0 deletions modules/reference/pages/properties/cluster-properties.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ Default replication factor for new topics.

*Default:* `1`

NOTE: In Redpanda Cloud, all new topics are created with a replication factor of 3.

---

=== default_window_sec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ create topics.
defaults to the cluster property `default_topic_partitions` (default `-1`).

|-r, --replicas |int16 |Replication factor (must be odd); -1 defaults to
the cluster's default_topic_replications (default -1).
the cluster's default_topic_replications (default -1). In Redpanda Cloud, the replication factor is set to 3.

|-c, --topic-config |string (repeatable) |Topic properties can be set by using `<key>=<value>`. For example `-c cleanup.policy=compact`. This flag is repeatable, so you can set multiple parameters in a single command.

Expand Down