Containers Dock!
This blog post explores how to use Docker containers to quickly configure and deploy the Tungsten Dashboard, a graphical user interface for managing Tungsten Clusters.
Using Docker containers offers a convenient and efficient way to deploy and manage the Tungsten Dashboard. This guide provides a step-by-step process and addresses potential issues to get you started quickly.
A Guide For Setting Up Tungsten Dashboard with Docker
The Docker method of installing the Tungsten Dashboard uses a pre-defined Docker container provided by Continuent containing Apache, PHP, HAProxy and the Dashboard itself.
Prerequisites
- Downloaded Tungsten Dashboard Docker image
- Access to a Linux host with Docker and Docker Compose installed
- Existing Tungsten Cluster
Dashboard via Docker - Where to Install?
In this blog post, we will expect you to try this on a test cluster, and for ease of deployment, directly on a database node.
Since the REST API that the Tungsten Dashboard depends upon only listens to localhost (127.0.0.1) by default, Dashboard requests to the manager API will fail from outside the Cluster node by default.
In a production environment, it is expected that the Tungsten Dashboard would run on a dedicated web server, NOT on a Cluster database (or witness) node! That means additional configuration is needed for a production setup.
To reach a cluster node via API, the listener IP address must be specified in the INI of all cluster database and witness nodes, and `tools/tpm update –replace-release` must be run from the software staging directory on all cluster database and witness nodes. Additionally, firewall rules must be created to allow traffic to pass as needed.
More information may be found here: https://docs.continuent.com/tungsten-dashboard-1.0/tungsten-dashboard-overview.html
Dashboard Docker Install - Quick Start
Below are the key steps needed to install and configure the Tungsten Dashboard via Docker.
- Download the latest Tungsten Dashboard Docker image from our portal.
- Login to the Continuent download portal at https://www.continuent.com/downloads
- Click on “Docker Image” in the horizontal menu in the middle of the page.
- Get the latest version of Tungsten Dashboard by clicking on the version number itself.
- The downloaded file should look something like:
tungsten-dashboard-docker-1.0.15-12.tar.gz
.
- Copy the downloaded software to the target Linux host:
desktop> scp tungsten-dashboard-docker-1.0.15-12.tar.gz tungsten@db1:
- SSH to the target host:
desktop> ssh tungsten@db1
- Extract the tarball to a temporary location like your home directory on that host:
shell> tar xvzf tungsten-dashboard-docker-1.0.15-12.tar.gz tungsten-dashboard-docker/ tungsten-dashboard-docker/README tungsten-dashboard-docker/config.php tungsten-dashboard-docker/docker-compose.yml tungsten-dashboard-docker/dshell tungsten-dashboard-docker/haproxy/ tungsten-dashboard-docker/haproxy/haproxy.cfg tungsten-dashboard-docker/hastat tungsten-dashboard-docker/settings.d/ tungsten-dashboard-docker/settings.d/apiAuth.json tungsten-dashboard-docker/settings.d/apiPassword.json tungsten-dashboard-docker/settings.d/apiSSL.json tungsten-dashboard-docker/settings.d/apiUser.json tungsten-dashboard-docker/settings.d/apiVersion.json tungsten-dashboard-docker/settings.d/startExpanded.json tungsten-dashboard-docker/settings.d/useHAProxy.json tungsten-dashboard-docker/tungsten_generate_haproxy.pl tungsten-dashboard-docker/tungsten-dashboard-docker-saved-1.0.15-12.tar
- Proceed to the extracted directory:
shell> cd tungsten-dashboard-docker
- Inform the Docker server of the new Dashboard image to install
shell> sudo docker load --input tungsten-dashboard-docker-saved-1.0.15-12.tar
- Create your desired Dashboard login credentials (i.e. user
tungsten
with passwordsecret
)in the.htpasswd
file under theetc/
folder:shell> (cd etc; htpasswd -c .htpasswd tungsten)
- Edit the
html/config.php
file and add the login you just created to theadministrators
line. Thetungsten
user is pre-populated, so you may skip this step if you used “tungsten
” as your user name. - Add explicit
/etc/hosts
entries to thedocker-compose.yml
file under theextra_hosts
sections for both services,haproxy
anddashboard
. Populate/etc/hosts
inside the container(s) by adding indented lines under theextra_hosts
: directive:shell> vi docker-compose.yml ... services: dashboard: extra_hosts: db1: 10.0.0.101 db2: 10.0.0.102 db3: 10.0.0.103 db4: 10.0.0.104 db5: 10.0.0.105 db6: 10.0.0.106 ... haproxy: extra_hosts: db1: 10.0.0.101 db2: 10.0.0.102 db3: 10.0.0.103 db4: 10.0.0.104 db5: 10.0.0.105 db6: 10.0.0.106 ...
- Configure cluster-specific HAProxy frontend and backend entries from your existing INI entries in one of two ways, and replace 8201 with your desired port number and append the results to the
haproxy/haproxy.cfg
file:- Running
tpm generate-haproxy-for-api
on an installed Tungsten node:The following will only work when a valid Tungsten install and /etc/tungsten/tungsten.ini file exists: shell> tpm generate-haproxy-for-api --port 8201 >> haproxy/haproxy.cfg
- Using the enclosed
./tungsten_generate_haproxy.pl
The following will only work when a valid /etc/tungsten/tungsten.ini file exists: shell> ./tungsten_generate_haproxy.pl --port 8201 >> haproxy/haproxy.cfg
- Running
dashboard
and haproxy
using the docker-compose
command:
shell> sudo docker-compose up -d
shell> sudo docker ps
shell> sudo docker logs haproxy
shell> sudo docker logs dashboard
- Use the username and password you created to login on the Tungsten Dashboard login page
- Enter the exact string
haproxy
and the port number used in HAProxy configuration (e.g.,8201
)
Browse to http://localhost:8080
Click on "Please click here to auto-define an existing service (suggested)"
Add the new cluster using:
Host Name: haproxy
Port Number: 8201
Additional Notes
- The Dashboard sees HAProxy under the hostname
haproxy
on port 8090-809X (depending on the HAProxy config). - The
dashboard
andhaproxy
containers are on an internal network that can see each other with these hostnames. - The netcat command
nc
is required to use the includedhastat
script:shell> yum -y install nc
- Use the enclosed
dshell
script to ssh to the container by providing the CONTAINER ID listed withdocker ps
as the only argument:shell> sudo docker ps shell> ./dshell {container name or containerid} Example: shell> ./dshell dashboard shell> ./dshell haproxy
Troubleshooting
- Full troubleshooting docs are here: https://docs.continuent.com/tungsten-dashboard-1.0/tungsten-dashboard-install-dashboard.html#tungsten-dashboard-install-dashboard-docker-troubleshooting
- To install tools for checking connectivity on a container:
shell> ./dshell {container name or containerid} shell> apt update shell> apt install iputils-ping telnet netcat-openbsd curl jq
- To check the HAProxy status:
shell> ./dshell haproxy root@f57d517b7acf:/# echo "show stat" | nc -U /var/lib/haproxy-stats-socket
- To check the Manager reachability:
shell> ./dshell haproxy root@f57d517b7acf:/# /usr/bin/curl -s --insecure --user tungsten:secret --request GET 'https://db1-demo.continuent.com:8090/api/v2/manager/cluster/status/' | jq .
- FD limit error: Increase the file descriptor limit for Docker by editing
/etc/sysconfig/docker
. - "Internal Server Error": Ensure the
.htpasswd
file is created with username and password. - Docker server not running: Start the Docker service.
Tungsten Dashboard via Docker: Wrap-Up
In this blog post, we explored the new support for running Tungsten Dashboard via Docker containers. This method allows for a rapid configuration of the GUI.
Comments
Add new comment