|
| 1 | +--- |
| 2 | +tags: |
| 3 | + - Enterprise Option |
| 4 | +displayed_sidebar: docsEnglish |
| 5 | +--- |
| 6 | + |
| 7 | +# ScalarDB Analytics Configurations |
| 8 | + |
| 9 | +This page provides a comprehensive reference for configuring all components of ScalarDB Analytics. |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +ScalarDB Analytics consists of three main components that require configuration: |
| 14 | + |
| 15 | +1. **ScalarDB Analytics server** - The server that hosts the catalog information and metering services |
| 16 | +2. **CLI client** - The command-line interface for managing catalogs and data sources |
| 17 | +3. **Spark integration** - Configuration for using ScalarDB Analytics with Apache Spark |
| 18 | + |
| 19 | +## ScalarDB Analytics server configuration |
| 20 | + |
| 21 | +The server is configured using a standard Java properties file (for example, `scalardb-analytics-server.properties`) that defines database connections, network settings, licensing, and optional features. |
| 22 | + |
| 23 | +### Metadata database configurations |
| 24 | + |
| 25 | +Configure the metadata database that stores catalog information. |
| 26 | + |
| 27 | +#### `db.url` |
| 28 | + |
| 29 | +- **Field:** `scalar.db.analytics.server.db.url` |
| 30 | +- **Description:** The JDBC URL for the metadata database used by ScalarDB Analytics. |
| 31 | + |
| 32 | +#### `db.username` |
| 33 | + |
| 34 | +- **Field:** `scalar.db.analytics.server.db.username` |
| 35 | +- **Description:** The username for connecting to the metadata database. |
| 36 | + |
| 37 | +#### `db.password` |
| 38 | + |
| 39 | +- **Field:** `scalar.db.analytics.server.db.password` |
| 40 | +- **Description:** The password for the metadata database user. |
| 41 | + |
| 42 | +### Server network configuration |
| 43 | + |
| 44 | +Configure network settings including service ports and TLS/SSL encryption. |
| 45 | + |
| 46 | +#### `catalog.port` |
| 47 | + |
| 48 | +- **Field:** `scalar.db.analytics.server.catalog.port` |
| 49 | +- **Description:** Port for the catalog service. |
| 50 | +- **Default value:** `11051` |
| 51 | + |
| 52 | +#### `metering.port` |
| 53 | + |
| 54 | +- **Field:** `scalar.db.analytics.server.metering.port` |
| 55 | +- **Description:** Port for the metering service. |
| 56 | +- **Default value:** `11052` |
| 57 | + |
| 58 | +#### `tls.enabled` |
| 59 | + |
| 60 | +- **Field:** `scalar.db.analytics.server.tls.enabled` |
| 61 | +- **Description:** Enable TLS/SSL for secure communication. |
| 62 | +- **Default value:** `false` |
| 63 | + |
| 64 | +#### `tls.cert_chain_path` |
| 65 | + |
| 66 | +- **Field:** `scalar.db.analytics.server.tls.cert_chain_path` |
| 67 | +- **Description:** Path to the server certificate chain file. Required when `tls.enabled` is `true`. |
| 68 | + |
| 69 | +#### `tls.private_key_path` |
| 70 | + |
| 71 | +- **Field:** `scalar.db.analytics.server.tls.private_key_path` |
| 72 | +- **Description:** Path to the server private key file. Required when `tls.enabled` is `true`. |
| 73 | + |
| 74 | +### License configuration |
| 75 | + |
| 76 | +Configure your ScalarDB Analytics license. |
| 77 | + |
| 78 | +#### `licensing.license_key` |
| 79 | + |
| 80 | +- **Field:** `scalar.db.analytics.server.licensing.license_key` |
| 81 | +- **Description:** Your ScalarDB Analytics license key. |
| 82 | + |
| 83 | +#### `licensing.license_check_cert_pem` |
| 84 | + |
| 85 | +- **Field:** `scalar.db.analytics.server.licensing.license_check_cert_pem` |
| 86 | +- **Description:** License verification certificate as PEM string. Either this or `license_check_cert_path` must be specified. |
| 87 | + |
| 88 | +#### `licensing.license_check_cert_path` |
| 89 | + |
| 90 | +- **Field:** `scalar.db.analytics.server.licensing.license_check_cert_path` |
| 91 | +- **Description:** Path to license verification certificate file. Either this or `license_check_cert_pem` must be specified. |
| 92 | + |
| 93 | +### Metering storage configuration |
| 94 | + |
| 95 | +Configure storage for metering data. |
| 96 | + |
| 97 | +#### `metering.storage.provider` |
| 98 | + |
| 99 | +- **Field:** `scalar.db.analytics.server.metering.storage.provider` |
| 100 | +- **Description:** Storage provider for metering data (`filesystem`, `aws-s3`, `azureblob`, `google-cloud-storage`). |
| 101 | + |
| 102 | +#### `metering.storage.containerName` |
| 103 | + |
| 104 | +- **Field:** `scalar.db.analytics.server.metering.storage.containerName` |
| 105 | +- **Description:** Container/bucket name for cloud storage. |
| 106 | +- **Default value:** `metering` |
| 107 | + |
| 108 | +#### `metering.storage.path` |
| 109 | + |
| 110 | +- **Field:** `scalar.db.analytics.server.metering.storage.path` |
| 111 | +- **Description:** Local directory path. Required when provider is `filesystem`. |
| 112 | + |
| 113 | +#### `metering.storage.accessKeyId` |
| 114 | + |
| 115 | +- **Field:** `scalar.db.analytics.server.metering.storage.accessKeyId` |
| 116 | +- **Description:** Access key ID for cloud storage providers. Required for `aws-s3`, `azureblob`, and `google-cloud-storage`. |
| 117 | + |
| 118 | +#### `metering.storage.secretAccessKey` |
| 119 | + |
| 120 | +- **Field:** `scalar.db.analytics.server.metering.storage.secretAccessKey` |
| 121 | +- **Description:** Secret access key for cloud storage providers. Required for `aws-s3`, `azureblob`, and `google-cloud-storage`. |
| 122 | + |
| 123 | +#### `metering.storage.prefix` |
| 124 | + |
| 125 | +- **Field:** `scalar.db.analytics.server.metering.storage.prefix` |
| 126 | +- **Description:** Optional prefix for all storage paths. |
| 127 | + |
| 128 | +## CLI client configuration |
| 129 | + |
| 130 | +The CLI client requires connection settings to communicate with the ScalarDB Analytics server using a Java properties file (for example, `client.properties`). |
| 131 | + |
| 132 | +## Configuration properties |
| 133 | + |
| 134 | +This section describes the configuration properties. |
| 135 | + |
| 136 | +### Server connection configuration |
| 137 | + |
| 138 | +The following is a list of configurations for connecting to the server. |
| 139 | + |
| 140 | +#### `server.host` |
| 141 | + |
| 142 | +- **Field:** `scalar.db.analytics.client.server.host` |
| 143 | +- **Description:** Hostname or IP address of the ScalarDB Analytics server. |
| 144 | + |
| 145 | +#### `server.catalog.port` |
| 146 | + |
| 147 | +- **Field:** `scalar.db.analytics.client.server.catalog.port` |
| 148 | +- **Description:** Port number for the catalog service. |
| 149 | +- **Default value:** `11051` |
| 150 | + |
| 151 | +#### `server.metering.port` |
| 152 | + |
| 153 | +- **Field:** `scalar.db.analytics.client.server.metering.port` |
| 154 | +- **Description:** Port number for the metering service. |
| 155 | +- **Default value:** `11052` |
| 156 | + |
| 157 | +### TLS configuration |
| 158 | + |
| 159 | +The following is a list of configurations for TLS. |
| 160 | + |
| 161 | +#### `server.tls.enabled` |
| 162 | + |
| 163 | +- **Field:** `scalar.db.analytics.client.server.tls.enabled` |
| 164 | +- **Description:** Enable TLS/SSL for server connections. |
| 165 | +- **Default value:** `false` |
| 166 | + |
| 167 | +#### `server.tls.ca_root_cert_path` |
| 168 | + |
| 169 | +- **Field:** `scalar.db.analytics.client.server.tls.ca_root_cert_path` |
| 170 | +- **Description:** Path to the CA certificate file for verifying server certificates. Required when `tls.enabled` is `true`. |
| 171 | + |
| 172 | +#### `server.tls.override_authority` |
| 173 | + |
| 174 | +- **Field:** `scalar.db.analytics.client.server.tls.override_authority` |
| 175 | +- **Description:** Override the server authority for TLS verification (useful for testing). |
| 176 | + |
| 177 | +## Spark integration configuration |
| 178 | + |
| 179 | +To use ScalarDB Analytics with Apache Spark, configure your Spark application by adding the necessary settings to your Spark configuration file (`spark-defaults.conf`). |
| 180 | + |
| 181 | +### Spark Core configuration |
| 182 | + |
| 183 | +The following is a list of configurations for Spark Core. |
| 184 | + |
| 185 | +#### `spark.jars.packages` |
| 186 | + |
| 187 | +- **Field:** `spark.jars.packages` |
| 188 | +- **Description:** Maven coordinates for ScalarDB Analytics dependencies. |
| 189 | + |
| 190 | +#### `spark.extraListeners` |
| 191 | + |
| 192 | +- **Field:** `spark.extraListeners` |
| 193 | +- **Description:** Register the ScalarDB Analytics metering listener. |
| 194 | + |
| 195 | +### Catalog configuration |
| 196 | + |
| 197 | +The following is a list of configurations for the catalog. |
| 198 | + |
| 199 | +#### `spark.sql.catalog.<catalog-name>` |
| 200 | + |
| 201 | +- **Field:** `spark.sql.catalog.<catalog-name>` |
| 202 | +- **Description:** Register the ScalarDB Analytics catalog implementation. Replace `<catalog-name>` with the exact name of the catalog created in ScalarDB Analytics server. Use `com.scalar.db.analytics.spark.catalog.ScalarDBAnalyticsCatalog` as the value. |
| 203 | + |
| 204 | +:::important |
| 205 | + |
| 206 | +The `<catalog-name>` must match the catalog name created in ScalarDB Analytics server using the CLI. For example, if you created a catalog named `production` in the server, use `spark.sql.catalog.production`. |
| 207 | + |
| 208 | +::: |
| 209 | + |
| 210 | +### Server connection configurations |
| 211 | + |
| 212 | +The following is a list of configurations for the server connection. |
| 213 | + |
| 214 | +#### `spark.sql.catalog.<catalog-name>.server.host` |
| 215 | + |
| 216 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.host` |
| 217 | +- **Description:** Hostname or IP address of the ScalarDB Analytics server. |
| 218 | + |
| 219 | +#### `spark.sql.catalog.<catalog-name>.server.catalog.port` |
| 220 | + |
| 221 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.catalog.port` |
| 222 | +- **Description:** Port number for the catalog service. |
| 223 | +- **Default value:** `11051` |
| 224 | + |
| 225 | +#### `spark.sql.catalog.<catalog-name>.server.metering.port` |
| 226 | + |
| 227 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.metering.port` |
| 228 | +- **Description:** Port number for the metering service. |
| 229 | +- **Default value:** `11052` |
| 230 | + |
| 231 | +### TLS/SSL configurations |
| 232 | + |
| 233 | +The following is a list of configurations for TLS/SSL. |
| 234 | + |
| 235 | +#### `spark.sql.catalog.<catalog-name>.server.tls.enabled` |
| 236 | + |
| 237 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.tls.enabled` |
| 238 | +- **Description:** Enable TLS/SSL for server connections. |
| 239 | +- **Default value:** `false` |
| 240 | + |
| 241 | +#### `spark.sql.catalog.<catalog-name>.server.tls.ca_root_cert_path` |
| 242 | + |
| 243 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.tls.ca_root_cert_path` |
| 244 | +- **Description:** Path to the CA certificate file for verifying server certificates. Required when `tls.enabled` is `true`. |
| 245 | + |
| 246 | +#### `spark.sql.catalog.<catalog-name>.server.tls.override_authority` |
| 247 | + |
| 248 | +- **Field:** `spark.sql.catalog.<catalog-name>.server.tls.override_authority` |
| 249 | +- **Description:** Override the server authority for TLS verification. |
| 250 | + |
| 251 | +Replace `<catalog-name>` with your chosen catalog name (for example, `analytics`). |
| 252 | + |
| 253 | +## Configuration examples |
| 254 | + |
| 255 | +This section provides some configuration examples. |
| 256 | + |
| 257 | +### Basic development configuration |
| 258 | + |
| 259 | +The following are examples of configurations for the server, CLI client, and Spark. |
| 260 | + |
| 261 | +#### Server configuration (`scalardb-analytics-server.properties`) |
| 262 | + |
| 263 | +```properties |
| 264 | +# Metadata database |
| 265 | +scalar.db.analytics.server.db.url=jdbc:postgresql://localhost:5432/scalardb_analytics |
| 266 | +scalar.db.analytics.server.db.username=dev_user |
| 267 | +scalar.db.analytics.server.db.password=dev_password |
| 268 | + |
| 269 | +# License |
| 270 | +scalar.db.analytics.server.licensing.license_key=YOUR_DEV_LICENSE_KEY |
| 271 | +scalar.db.analytics.server.licensing.license_check_cert_path=/path/to/license_cert.pem |
| 272 | + |
| 273 | +# Metering storage (filesystem for development) |
| 274 | +scalar.db.analytics.server.metering.storage.provider=filesystem |
| 275 | +scalar.db.analytics.server.metering.storage.path=/tmp/scalardb-analytics-metering |
| 276 | +``` |
| 277 | + |
| 278 | +#### CLI client configuration (`client.properties`) |
| 279 | + |
| 280 | +```properties |
| 281 | +scalar.db.analytics.client.server.host=localhost |
| 282 | +``` |
| 283 | + |
| 284 | +#### Spark configuration (`spark-defaults.conf`) |
| 285 | + |
| 286 | +```properties |
| 287 | +spark.jars.packages com.scalar-labs:scalardb-analytics-spark-all-3.5_2.12:3.16.2 |
| 288 | +spark.extraListeners com.scalar.db.analytics.spark.metering.ScalarDbAnalyticsListener |
| 289 | +spark.sql.catalog.analytics com.scalar.db.analytics.spark.catalog.ScalarDBAnalyticsCatalog |
| 290 | +spark.sql.catalog.analytics.server.host localhost |
| 291 | +``` |
| 292 | + |
| 293 | +### Production configuration with TLS |
| 294 | + |
| 295 | +The following are examples of configurations for TLS, CLI client, and Spark in production environments. |
| 296 | + |
| 297 | +#### Server configuration (`scalardb-analytics-server.properties`) |
| 298 | + |
| 299 | +```properties |
| 300 | +# Metadata database |
| 301 | +scalar.db.analytics.server.db.url=jdbc:postgresql://db.internal:5432/scalardb_analytics_prod |
| 302 | +scalar.db.analytics.server.db.username=analytics_prod |
| 303 | +scalar.db.analytics.server.db.password=your_secure_password |
| 304 | + |
| 305 | +# gRPC ports |
| 306 | +scalar.db.analytics.server.catalog.port=11051 |
| 307 | +scalar.db.analytics.server.metering.port=11052 |
| 308 | + |
| 309 | +# TLS |
| 310 | +scalar.db.analytics.server.tls.enabled=true |
| 311 | +scalar.db.analytics.server.tls.cert_chain_path=/path/to/server.crt |
| 312 | +scalar.db.analytics.server.tls.private_key_path=/path/to/server.key |
| 313 | + |
| 314 | +# License |
| 315 | +scalar.db.analytics.server.licensing.license_key=YOUR_LICENSE_KEY |
| 316 | +scalar.db.analytics.server.licensing.license_check_cert_pem=-----BEGIN CERTIFICATE-----\nMIID...certificate content...\n-----END CERTIFICATE----- |
| 317 | + |
| 318 | +# Metering storage (S3) |
| 319 | +scalar.db.analytics.server.metering.storage.provider=aws-s3 |
| 320 | +scalar.db.analytics.server.metering.storage.containerName=analytics-metering |
| 321 | +scalar.db.analytics.server.metering.storage.accessKeyId=AKIAIOSFODNN7EXAMPLE |
| 322 | +scalar.db.analytics.server.metering.storage.secretAccessKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
| 323 | +scalar.db.analytics.server.metering.storage.prefix=prod/ |
| 324 | +``` |
| 325 | + |
| 326 | +#### CLI Client configuration (`client.properties`) |
| 327 | + |
| 328 | +```properties |
| 329 | +scalar.db.analytics.client.server.host=analytics.example.com |
| 330 | +scalar.db.analytics.client.server.tls.enabled=true |
| 331 | +scalar.db.analytics.client.server.tls.ca_root_cert_path=/path/to/cert.pem |
| 332 | +``` |
| 333 | + |
| 334 | +#### Spark configuration (`spark-defaults.conf`) |
| 335 | + |
| 336 | +```properties |
| 337 | +spark.jars.packages com.scalar-labs:scalardb-analytics-spark-all-3.5_2.12:3.16.2 |
| 338 | +spark.extraListeners com.scalar.db.analytics.spark.metering.ScalarDbAnalyticsListener |
| 339 | +spark.sql.catalog.analytics com.scalar.db.analytics.spark.catalog.ScalarDBAnalyticsCatalog |
| 340 | +spark.sql.catalog.analytics.server.host analytics.example.com |
| 341 | +spark.sql.catalog.analytics.server.tls.enabled true |
| 342 | +spark.sql.catalog.analytics.server.tls.ca_root_cert_path /path/to/cert.pem |
| 343 | +``` |
| 344 | + |
| 345 | +## Next steps |
| 346 | + |
| 347 | +- [Catalog management](catalog-management.mdx) - Learn how to manage catalogs and data sources |
| 348 | +- [Run analytical queries](run-analytical-queries.mdx) - Start running queries with your configuration |
| 349 | +- [Deployment guide](deployment.mdx) - Deploy ScalarDB Analytics in production |
0 commit comments