Advanced Configuration
Use a Custom Port
Expose the main application on a port other than the default port.
Steps:
Update the port mapping
-p <custom-port>:3000
parameter.Provide the following environment variable:
-e GDCN_PUBLIC_URL=http://localhost:<custom-port>
Example: Change the port to the custom value of 3333
by running the following commands
docker run -e GDCN_LICENSE_KEY -i -t -e GDCN_PUBLIC_URL=http://localhost:3333 -p 3333:3000 -p 5432:5432 \
-v gd-volume:/data gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -e GDCN_PUBLIC_URL=http://localhost:3333 -p 3333:3000 -p 5432:5432 `
-v gd-volume:/data gooddata/gooddata-cn-ce:3.5.1
Change Your Hostname
Use the GDCN_PUBLIC_URL
environment variable to run your
GoodData.CN Container Edition under a different hostname.
Let’s say you want your GoodData.CN Container Edition to be accessible under https://analytics.example.com/
.
All you need to do is to setup a reverse proxy (like Traefik or Nginx) in front of the docker
container where your GoodData.CN Container Edition is deployed. It’s up to you to provide a valid TLS certificate for
your public website, either by assigning certificate and key files, or by configuring an
ACME Client in your reverse proxy.
Example:
The following example shows example integration with Traefik2, running on ports 80 and 443, while GoodData.CN Container Edition container runs on port 3000.
This is an example configuration for docker compose
to run GoodData.CN Container Edition with a custom
hostname, with TLS terminated on Traefik, and certificates provisioned by the Let’s Encrypt
service. The certificate and key are stored in file acme.json
located in docker volume
traefik-data
.
Create .env
file where you place environment variables, updated according to your configuration:
GDCN_LICENSE_KEY=PUT-YOUR-LICENSE-KEY-HERE
PUBLIC_HOSTNAME=gooddata.example.com
In the same directory, create file docker-compose.yml
with the following
contents:
# docker-compose.yml
version: '3.7'
services:
traefik:
image: traefik:v2.5
command:
- --providers.docker=true
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.websecure.address=:443
- --certificatesresolvers.le.acme.storage=/etc/traefik/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --certificatesresolvers.le.acme.httpchallenge.entrypoint=web
ports:
- 80:80
- 443:443
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "traefik-data:/etc/traefik"
gooddata-cn-ce:
image: gooddata/gooddata-cn-ce:latest
environment:
GDCN_LICENSE_KEY: ${GDCN_LICENSE_KEY}
GDCN_PUBLIC_URL: https://${PUBLIC_HOSTNAME}
ports:
- 3000
labels:
- "traefik.http.routers.gooddata-cn-ce.rule=Host(`${PUBLIC_HOSTNAME}`)"
- "traefik.http.routers.gooddata-cn-ce.tls=true"
- "traefik.http.routers.gooddata-cn-ce.tls.certresolver=le"
volumes:
- "gd-cn-data:/data:rw"
volumes:
gd-cn-data:
traefik-data:
Then you can start docker compose stack with command docker compose up
.
Bypass CPU and Memory Check
At the very begining of container startup, GoodData.CN Container Edition tries to verify that the host has enough resources to reliably run all services it needs. On rare ocassions this check may fail and prevent the container from starting.
If you are sure that your computer satisfies the minimal HW requirements, you may bypass this
check by setting environment variable GDCN_SKIP_RESOURCE_CHECK
to value 1
.
Change Default Bootstrap Token
GoodData.CN Container Edition comes with an initial, predefined bootstrap token that is used to access the API. The value of the bootstrap token is derived by encoding the <adminUser>:bootstrap:<adminPassword>
string to Base64 format, see Create the Bootstrap Token for details.
You can modify the value of the bootstrap token by changing the <adminPassword>
value that is set by the GDCN_TOKEN_SECRET
environment variable:
Environment variable | Default value | Notes |
---|---|---|
GDCN_TOKEN_SECRET | admin123 | The value of the final token derived from admin:bootstrap:admin123 is YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz |
Example: Run a GoodData.CN Container Edition container with a modified <adminPassword>
part of the bootstrap token using the following command:
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
-e GDCN_TOKEN_SECRET=mySuperS3cr3t gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
-e GDCN_TOKEN_SECRET=mySuperS3cr3t gooddata/gooddata-cn-ce:3.5.1
To find the value of your custom bootstrap token, convert the following string to Base64 format:
echo -n 'admin:bootstrap:mySuperS3cr3t' | base64
Your custom bootstrap token is YWRtaW46Ym9vdHN0cmFwOm15U3VwZXJTM2NyM3Q=
.
Note
The bootstrap token can be also changed on an existing deployment, if you are using
attached docker volume. Start a new container with the previous volume and updated value of
GDCN_TOKEN_SECRET
environment variable. The bootstrap token is updated according to this new value.
Disable creating demo account
Demo user account demo@example.com
is created automatically on container
start. If this functionality is undesired, you may suppress demo account
creation by setting environment variable GDCN_DISABLE_DEMO_USER
to any non-zero value.
You are fully responsible for creating all users using API
authenticated by bootstrap token.
Environment variable | Default value | Notes |
---|---|---|
GDCN_DISABLE_DEMO_USER | 0 | demo account is created by default. Setting to any non-zero value suppress demo account creation |
Reconfigure Redis
GoodData.CN uses Redis for caching results metadata. The default size of memory available to Redis instance is 256 MB. The value should be sufficient, but if you need to fine-tune Redis server, the following environment variables can help you:
Environment variable | Default value | Notes |
---|---|---|
GDCN_REDIS_MAXMEMORY | 256m | |
GDCN_REDIS_EXTRA_OPTIONS | None | The following options are always present: --bind 127.0.0.1 --logfile "" --dir /data/redis --maxmemory "$GDCN_REDIS_MAXMEMORY" --maxmemory-policy allkeys-lru --rdbcompression yes --rdbchecksum yes |
Example: Run a GoodData.CN Container Edition container with more Redis memory and with a more detailed logging option by running the following commands
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
-e GDCN_REDIS_MAXMEMORY=1gb -e GDCN_REDIS_EXTRA_OPTIONS="--loglevel verbose" gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
-e GDCN_REDIS_MAXMEMORY=1gb -e GDCN_REDIS_EXTRA_OPTIONS="--loglevel verbose" gooddata/gooddata-cn-ce:3.5.1
Reconfigure PostgreSQL
GoodData.CN Container Edition uses a built-in instance of PostgreSQL 13 server. Configuration of this database server can be changed
during the container startup using custom configuration snippets, bind-mounted from the docker host to path /etc/postgresql/11/main/conf.d/
. You can either mount a single file, or the whole directory containing files with .conf
extensions.
These files are applied to PostgreSQL configuration in alphabetic order, in case of duplicate settings the last one wins.
Example: Run a GoodData.CN Container Edition container with customized PostgreSQL settings.
Let’s have a file called 99-custom.conf
in your current directory where GoodData.CN Container Edition container is being
started. It’s content is a regular PostgreSQL configuration file, containing for example:
shared_buffers = 300MB # min 128kB
temp_buffers = 16MB # min 800kB
work_mem = 10MB # min 64kB
maintenance_work_mem = 128MB # min 1MB
Then you can bind-mount this file while running the container by running the following commands
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
-v $PWD/99-custom.conf:/etc/postgresql/11/main/conf.d/99-custom.conf \
gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
-v $PWD/99-custom.conf:/etc/postgresql/11/main/conf.d/99-custom.conf `
gooddata/gooddata-cn-ce:3.5.1
Change the Logging Verbosity Level
Two environment variables can be passed through the docker command line to change the level of the log’s verbosity.
APP_LOGLEVEL
- defines logging level for GoodData.CN components.PULSAR_LOGLEVEL
- defines logging level for Apache Pulsar.
Both these variables can contain one of ERROR
, WARN
, INFO
, DEBUG
or TRACE
. The default is WARN
.
Example: Run a GoodData.CN Container Edition container with increased application logging verbosity by running the following commands
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data \
-e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data `
-e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:3.5.1
Use Custom JDBC Drivers
Due to licensing restrictions, GoodData is not allowed to distribute the JDBC drivers for some databases. However, you can inject the drivers that we cannot distribute.
Use the following procedure to inject custom JDBC drivers into the Container Edition of GoodData.CN.
Steps:
- Download the driver to a local folder. For example, to
/tmp/db-drivers/BIGQUERY
.
Notes
- Store each driver inside a dedicated folder.
- Unpack the driver files if necessary.
- Complete any additional steps for your database as described in Supported databases.
- With the absolute path to
db-drivers
specified in the command line arguments, start the GoodData.CN Container Edition container using the following commands
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data -v /tmp/db-drivers:/opt/extra-drivers \
-e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:3.5.1
docker run -e GDCN_LICENSE_KEY -i -t -p 3000:3000 -p 5432:5432 -v gd-volume:/data -v /tmp/db-drivers:/opt/extra-drivers `
-e APP_LOGLEVEL=INFO gooddata/gooddata-cn-ce:3.5.1