-
Notifications
You must be signed in to change notification settings - Fork 4
SQL GA - Get started #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rp-sql
Are you sure you want to change the base?
SQL GA - Get started #571
Changes from all commits
a2ee5eb
9fe925a
b787bf7
6caf890
469c5e8
61bd49e
76d113a
fa463e1
6eb3a66
50d7131
d525341
a0b51f4
746cf36
55bf450
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,253 @@ | ||
| = Enable Redpanda SQL on a BYOC Cluster | ||
| :description: Enable the Redpanda SQL engine on a BYOC cluster so you can query streaming data with standard PostgreSQL syntax. | ||
| :page-topic-type: how-to | ||
| :personas: platform_admin, data_engineer | ||
| :learning-objective-1: Enable Redpanda SQL on a new or existing BYOC cluster | ||
| :learning-objective-2: Scale or disable the SQL engine | ||
| :learning-objective-3: Verify that the SQL engine is running and ready to accept connections | ||
|
|
||
| Enable Redpanda SQL on a Bring Your Own Cloud (BYOC) cluster so you can query streaming data in Redpanda topics using standard PostgreSQL syntax. For Iceberg-enabled topics, queries can span both the streaming topic and its Iceberg history. See xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg-enabled topics] for that workflow. | ||
|
|
||
| Use this page to: | ||
|
|
||
| * [ ] {learning-objective-1} | ||
| * [ ] {learning-objective-2} | ||
| * [ ] {learning-objective-3} | ||
|
|
||
| NOTE: Redpanda SQL is currently available only on BYOC clusters running on AWS. | ||
|
|
||
| == Prerequisites | ||
|
|
||
| To enable Redpanda SQL, you need: | ||
|
|
||
| * A Redpanda Cloud organization on xref:billing:billing.adoc[usage-based billing]. | ||
|
kbatuigas marked this conversation as resolved.
|
||
| * Admin permissions in your Redpanda Cloud organization. | ||
| * If using the link:/api/doc/cloud-controlplane/topic/topic-cloud-api-overview[Cloud API] to enable SQL, a valid bearer token for the API. See link:/api/doc/cloud-controlplane/authentication[Authenticate to the Cloud API]. | ||
|
|
||
| == Enable Redpanda SQL | ||
|
|
||
| You can enable Redpanda SQL on a new or existing BYOC cluster. | ||
|
|
||
| === On a new cluster | ||
|
|
||
| [tabs] | ||
| ===== | ||
| Cloud Console:: | ||
| + | ||
| -- | ||
| . Log in to https://cloud.redpanda.com[Redpanda Cloud^]. | ||
| . Start creating a new BYOC cluster on AWS. For details and prerequisites, see xref:get-started:cluster-types/byoc/aws/create-byoc-cluster-aws.adoc[]. | ||
| . In the cluster creation form, select the option to enable SQL. | ||
| // TODO: Confirm guidance to provide on selecting capacity. The node-count | ||
| // selection is expected to be replaced with RPUs | ||
| . Choose the number of SQL nodes to deploy. | ||
| + | ||
| The minimum is one node to enable SQL. You can scale up (maximum nine nodes) or down later as needed, but the cluster must have at least one SQL node to run the engine. | ||
| . Complete the remaining cluster configuration and deploy. | ||
| -- | ||
|
|
||
| Cloud API:: | ||
| + | ||
| -- | ||
| . Authenticate to the link:/api/doc/cloud-controlplane/topic/topic-cloud-api-overview[Cloud API]. For details, see link:/api/doc/cloud-controlplane/authentication[Authenticate to the Cloud API]. | ||
| // TODO: Is selecting capacity (currently node count, expected to change to RPUs) | ||
| // available with this endpoint? | ||
| . Make a link:/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster[`POST /v1/clusters`] request with `rpsql.enabled` set to `true` in the cluster spec: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| curl -X POST "https://api.redpanda.com/v1/clusters" \ | ||
|
jacekseligarp marked this conversation as resolved.
|
||
| -H "Authorization: Bearer $AUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "cluster": { | ||
| "name": "<cluster-name>", | ||
| "cloud_provider": "CLOUD_PROVIDER_AWS", | ||
| "type": "TYPE_BYOC", | ||
| "region": "<region>", | ||
| "zones": [ <zones> ], | ||
| "throughput_tier": "<tier>", | ||
| "resource_group_id": "<resource-group-id>", | ||
| "rpsql": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| }' | ||
| ---- | ||
| + | ||
| For the full request body and field reference, see the link:/api/doc/cloud-controlplane/operation/operation-clusterservice_createcluster[Create Cluster API]. | ||
| . The request returns the ID of a long-running operation. Poll the link:/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation[`GET /v1/operations/{operation.id}`] endpoint until the operation completes. | ||
| -- | ||
| ===== | ||
|
|
||
| === On an existing cluster | ||
|
|
||
| // TODO: The node-count selection in the Edit RP SQL dialog is expected to be | ||
| // replaced with one for RPUs | ||
|
|
||
| [tabs] | ||
| ===== | ||
| Cloud Console:: | ||
| + | ||
| -- | ||
| . Log in to https://cloud.redpanda.com[Redpanda Cloud^] and open your cluster. | ||
| . From the left navigation, select *Dataplane settings*. | ||
| . On the *Cluster* tab, find the *RP SQL* row and click *Edit*. | ||
| . In the *Edit RP SQL* dialog, select *Enable*, set the *Number of RP SQL nodes* (1-9), and click *Save*. | ||
| -- | ||
|
|
||
| Cloud API:: | ||
| + | ||
| -- | ||
| . Authenticate to the link:/api/doc/cloud-controlplane/topic/topic-cloud-api-overview[Cloud API]. For details, see link:/api/doc/cloud-controlplane/authentication[Authenticate to the Cloud API]. | ||
| . Locate the cluster ID in the *Details* section of the cluster overview in the Cloud Console. | ||
| . Make a link:/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster[`PATCH /v1/clusters/{cluster.id}`] request, replacing `{cluster.id}` with your cluster ID: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| curl -X PATCH "https://api.redpanda.com/v1/clusters/{cluster.id}" \ | ||
|
jacekseligarp marked this conversation as resolved.
|
||
| -H "Authorization: Bearer $AUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"rpsql":{"enabled":true}}' | ||
| ---- | ||
| + | ||
| The request returns the ID of a long-running operation. Poll the link:/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation[`GET /v1/operations/{operation.id}`] endpoint until the operation completes: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| curl -X GET "https://api.redpanda.com/v1/operations/{operation.id}" \ | ||
| -H "Authorization: Bearer $AUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" | ||
| ---- | ||
| + | ||
| When the operation is complete, the response shows `"state": "STATE_COMPLETED"`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to talk a bit more about it, I'll send you a link to slack thread.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added some guidance here https://github.com/redpanda-data/cloud-docs/pull/571/changes#diff-53e047807d28a0255b66ea613665a131405259a0926d855ba2b3ab3dd13fbe5bR129 but this is based on current state afaik, we can update later if the UX is changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should sync with @c-julin on this one :) |
||
| -- | ||
| ===== | ||
|
|
||
| == Scale Redpanda SQL | ||
|
|
||
| Redpanda SQL supports horizontal scaling from one to nine nodes per cluster. You cannot scale to zero nodes. To remove Redpanda SQL from a cluster, disable the SQL engine instead. | ||
|
|
||
| // TODO: Scaling unit is changing. The node-count input (1-9) shown in the | ||
| // current UI is expected to be replaced with RPUs | ||
|
|
||
| [tabs] | ||
| ===== | ||
| Cloud Console:: | ||
| + | ||
| -- | ||
| . Log in to https://cloud.redpanda.com[Redpanda Cloud^] and open your cluster. | ||
| . From the left navigation, select *Dataplane settings*. | ||
| . On the *Cluster* tab, find the *RP SQL* row and click *Edit*. | ||
| . In the *Edit RP SQL* dialog, keep *Enable* selected, update *Number of RP SQL nodes* to a value between 1 and 9, and click *Save*. | ||
| -- | ||
|
|
||
| Cloud API:: | ||
| + | ||
| -- | ||
| Make a link:/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster[`PATCH /v1/clusters/{cluster.id}`] request with the new replica count. Replace `{cluster.id}` with your cluster ID and `<n>` with a value between 1 and 9: | ||
|
|
||
| [,bash] | ||
| ---- | ||
| curl -X PATCH "https://api.redpanda.com/v1/clusters/{cluster.id}" \ | ||
| -H "Authorization: Bearer $AUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"rpsql":{"replicas":<n>}}' | ||
| ---- | ||
|
|
||
| The request returns the ID of a long-running operation. Poll link:/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation[`GET /v1/operations/{operation.id}`] until the operation completes. | ||
| -- | ||
| ===== | ||
|
|
||
| == Verify the SQL engine is running | ||
|
|
||
| After you enable Redpanda SQL, the cluster overview page in the Cloud Console shows the *SQL* tab and the *Details* pane displays the number of SQL nodes deployed with the cluster. | ||
|
|
||
| // TODO: Confirm UI changes for SQL engine ready indicator | ||
| The *SQL* tab appears as soon as you enable SQL, but you can't connect until the engine is fully provisioned. Provisioning can take up to 30 minutes. | ||
|
|
||
| Wait for the node-ready status indicator on the overview page to show the engine is ready. For the API flow, poll the long-running operation until it returns `STATE_COMPLETED`. | ||
|
|
||
| To verify the SQL engine is running, use the connection details on the *SQL* tab to connect with a PostgreSQL client, such as `psql` (v16 or later required). | ||
|
|
||
| To connect using a bearer token (xref:manage:rpk/rpk-install.adoc[`rpk` v26.1.6+] required): | ||
|
|
||
| . Log in to Redpanda Cloud with `rpk cloud login`: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| rpk cloud login | ||
| ---- | ||
|
|
||
| . Retrieve a temporary authentication token for the SQL engine: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| rpsql_token=$(rpk cloud auth token) | ||
|
kbatuigas marked this conversation as resolved.
|
||
| ---- | ||
|
|
||
| . Connect with `psql` using the bearer token: | ||
| + | ||
| [,bash] | ||
| ---- | ||
| psql "host=<sql-external-endpoint> port=5432 dbname=oxla user=ignored password=$rpsql_token options='-c auth_method=bearer' sslmode=require" | ||
|
kbatuigas marked this conversation as resolved.
|
||
| ---- | ||
|
|
||
| == Inspect your SQL cluster | ||
|
|
||
| Redpanda SQL provides built-in commands to inspect the state of your SQL cluster: | ||
|
|
||
| [,sql] | ||
| ---- | ||
| SHOW NODES; -- List SQL compute nodes and their status | ||
| SHOW REDPANDA CATALOGS; -- List Redpanda catalogs | ||
| SHOW ICEBERG CATALOGS; -- List Iceberg catalogs | ||
| SHOW REDPANDA TABLES; -- List SQL tables mapped to Redpanda topics | ||
| SHOW QUERIES; -- List currently running queries | ||
| ---- | ||
|
|
||
| == Disable Redpanda SQL | ||
|
|
||
| [WARNING] | ||
| ==== | ||
| Disabling Redpanda SQL tears down the SQL compute engine and clears its catalog state (catalog metadata, table mappings, and role/grant data). In-flight queries fail when SQL is disabled. | ||
| ==== | ||
|
|
||
| Redpanda topic data, Schema Registry subjects, and any Iceberg-committed history for Iceberg-enabled topics are not affected. The Redpanda cluster itself continues to run normally; only the SQL engine and its associated state are removed. | ||
|
|
||
| Re-enabling SQL on the same cluster provisions a fresh engine: no prior catalog state, table mappings, or grants are restored. You must re-create catalogs, tables, and grants after re-enabling. | ||
|
|
||
| [tabs] | ||
| ===== | ||
| Cloud Console:: | ||
| + | ||
| -- | ||
| . Log in to https://cloud.redpanda.com[Redpanda Cloud^] and open your cluster. | ||
| . From the left navigation, select *Dataplane settings*. | ||
| . On the *Cluster* tab, find the *RP SQL* row and click *Edit*. | ||
| . In the *Edit RP SQL* dialog, select *Disable*, then click *Save*. | ||
| -- | ||
|
|
||
| Cloud API:: | ||
| + | ||
| -- | ||
| Make a link:/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster[`PATCH /v1/clusters/{cluster.id}`] request with `rpsql.enabled` set to `false`. Replace `{cluster.id}` with your cluster ID: | ||
|
|
||
| [,bash] | ||
| ---- | ||
| curl -X PATCH "https://api.redpanda.com/v1/clusters/{cluster.id}" \ | ||
| -H "Authorization: Bearer $AUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"rpsql":{"enabled":false}}' | ||
| ---- | ||
|
|
||
| The request returns the ID of a long-running operation. Poll link:/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation[`GET /v1/operations/{operation.id}`] until the operation completes. | ||
| -- | ||
| ===== | ||
|
|
||
| == Next steps | ||
|
|
||
| * xref:sql:get-started/sql-quickstart.adoc[Quickstart]: Connect to Redpanda SQL with `psql` and run your first query. | ||
| // TODO: Uncomment once DOC-1999 merges (target page is on that branch). | ||
| // * xref:sql:connect-to-sql/authenticate.adoc[Authenticate to Redpanda SQL]: Connect with an OIDC bearer token, OIDC client credentials, or a SCRAM password for clients that don't support OIDC. | ||
| * xref:reference:sql/index.adoc[Redpanda SQL reference]: Explore the full SQL syntax, data types, functions, and clauses. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| = Get Started with Redpanda SQL | ||
| :description: Get started with Redpanda SQL, a column-oriented OLAP query engine built into Redpanda Cloud that lets you query streaming topics using standard SQL. | ||
| :page-layout: index |
Uh oh!
There was an error while loading. Please reload this page.