Docker Method
This section describes the docker method of installing the Tungsten Dashboard using a pre-defined Docker container provided by Continuent containing Apache, PHP, HAProxy and the Dashboard.
Dashboard Docker Install - Quick Start
Below are the key steps needed to install the Tungsten Dashboard via Docker.
Copy the downloaded software to the target Linux host:
desktop> scp tungsten-dashboard-docker-1.0.17-1.tar.gz tungsten@db1:SSH to the target host:
desktop> ssh tungsten@db1Extract the tarball to a temporary location like your home directory on that host:
shell> tar xvzf tungsten-dashboard-docker-1.0.17-1.tar.gztungsten-dashboard-docker/tungsten-dashboard-docker/READMEtungsten-dashboard-docker/config.phptungsten-dashboard-docker/docker-compose.ymltungsten-dashboard-docker/dshelltungsten-dashboard-docker/haproxy/tungsten-dashboard-docker/haproxy/haproxy.cfgtungsten-dashboard-docker/hastattungsten-dashboard-docker/settings.d/tungsten-dashboard-docker/settings.d/apiAuth.jsontungsten-dashboard-docker/settings.d/apiPassword.jsontungsten-dashboard-docker/settings.d/apiSSL.jsontungsten-dashboard-docker/settings.d/apiUser.jsontungsten-dashboard-docker/settings.d/apiVersion.jsontungsten-dashboard-docker/settings.d/startExpanded.jsontungsten-dashboard-docker/settings.d/useHAProxy.jsontungsten-dashboard-docker/tungsten_generate_haproxy.pltungsten-dashboard-docker/tungsten-dashboard-docker-saved-1.0.17-1.tarProceed to the extracted directory:
shell> cd tungsten-dashboard-dockerInform the Docker server of the new Dashboard image to install:
shell> sudo docker load --input tungsten-dashboard-docker-saved-1.0.17-1.tarCreate Dashboard login credentials, i.e. user tungsten with password secret:
[object Object]Add explicit etc/hosts entries under the extra_hosts sections for both services,
haproxyanddashboard:shell> vi docker-compose.ymlCreate cluster-specific HAProxy entries:
Note the following will only work when a valid Tungsten install and
/etc/tungsten/tungsten.inifile exists:shell > tpm generate-haproxy-for-api --port 8201 >> haproxy/haproxy.cfgLaunch the containers:
shell> sudo docker-compose up -dValidate that everything is running properly:
shell> sudo docker psshell> sudo docker logs haproxyshell> sudo docker logs dashboardView the GUI in a browser:
Browse to http://localhost:8080Click on "Please click here to auto-define an existing service (recommended)"Add the new cluster using:Host Name: haproxyPort Number: 8201
Dashboard Docker Install - Details
Create the
.htpasswdfile under theetc/folder with your desired login and password for the Dashboard:shell> (cd etc; htpasswd -c .htpasswd tungsten)Edit the
config.jsonfile and add the login you just created to theadministratorsline. Thetungstenuser is pre-populated.Create the HAProxy frontend and backend entries from your existing INI by running either
tpm generate-haproxy-for-apior the enclosed./tungsten_generate_haproxy.pl- for example, to append the results to thehaproxy/haproxy.cfgfile:shell> ./tungsten_generate_haproxy.pl >> haproxy/haproxy.cfgPopulate
/etc/hostsinside the container(s) by adding indented lines under theextra_hosts:directive:shell> vi docker-compose.yml...services:dashboard:extra_hosts:db1: 10.0.0.101db2: 10.0.0.102db3: 10.0.0.103db4: 10.0.0.104db5: 10.0.0.105db6: 10.0.0.106...haproxy:extra_hosts:db1: 10.0.0.101db2: 10.0.0.102db3: 10.0.0.103db4: 10.0.0.104db5: 10.0.0.105db6: 10.0.0.106...Run the two containers via the
sudo docker-compose up -dcommand.Validate the containers via the
sudo docker pscommand.Point your browser to http://localhost:8080
Click on "Please click here to auto-define an existing service (recommended)"
Add the new cluster using hostname
haproxyand the frontend port number(s) created above, i.e.8201
NOTES
The Dashboard sees HAProxy under the hostname
haproxyon port 8090-809X (depending on the haproxy config).The
dashboardandhaproxycontainers are on an internal network that can see each other with these hostnames.The netcat command
ncis required to use the includedhastatscript:shell> yum -y install ncUse the enclosed
dshellscript to ssh to the container by providing the CONTAINER ID listed withdocker psas the only argument:shell> sudo docker psshell> ./dshell {container name or containerid}For example:
[object Object]
Docker Compose Quick Reference Guide
Docker-compose Install Summary
To install a different version of Compose, substitute 1.29.2 below with the version of Compose you want to use...
shell> sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
shell> sudo chmod +x /usr/local/bin/docker-compose
shell> sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
shell> docker-compose --version
Click here to see the Docker documentation for more information about docker-compose
Docker-compose Key Tasks Summary
== Start in foreground mode:
shell> sudo docker-compose up
== Start as a daemon:
shell> sudo docker-compose up -d
== Stop all containers:
shell> sudo docker-compose down
Docker Quick Reference Guide
== View the logs from a container:
shell> sudo docker logs {ID|name}
== Login to the shell on a container:
shell> sudo docker exec -it {ID|name} /bin/bash
~or~
shell> ./dshell {ID|name}
== List all containers:
shell> sudo docker ps
== Restart a container:
shell> sudo docker restart {ID}
Dashboard Docker Install - Troubleshooting
To install tools for checking connectivity on a container:
shell> ./dshell {container name or containerid}shell> apt updateshell> apt install iputils-ping telnet netcat-openbsd curl jqTo check the HAProxy status:
shell> ./dshell haproxyroot@f57d517b7acf:/# echo "show stat" | nc -U /var/lib/haproxy-stats-socketTo check the Manager reachability:
shell> ./dshell haproxyroot@f57d517b7acf:/# /usr/bin/curl -s --insecure --user tungsten:secret --request GET 'https://db1-demo.continuent.com:8090/api/v2/manager/cluster/status/' | jq .ERROR:
Cannot raise FD limit to 8066, limit is 1024
CAUSE:
/etc/sysconfig/docker has incorrect options configured
SOLUTION:
shell> sudo docker-compose downshell> vi /etc/sysconfig/docker==> CHANGE FROM:OPTIONS="--default-ulimit nofile=1024:4096"==> TO:#OPTIONS="--default-ulimit nofile=1024:4096"OPTIONS=""shell> sudo service docker restartshell> sudo docker-compose up -dERROR DETAILS:
shell> sudo docker-compose up...haproxy | [NOTICE] 161/185553 (1) : haproxy version is 2.3.10-4764f0ehaproxy | [NOTICE] 161/185553 (1) : path to executable is /usr/local/sbin/haproxyhaproxy | [ALERT] 161/185553 (1) : [haproxy.main()] Cannot raise FD limit to 8066, limit is 1024.haproxy exited with code 1...shell> ps -ef | grep dockerroot 2681 1 0 12:57 ? 00:00:10 /usr/bin/dockerd --default-ulimit nofile=1024:4096ERROR:
Dashboard shows "Internal Server Error" in a browser; logs show "Could not open password file: /var/www/html/etc/.htpasswd"
CAUSE:
Forgot to create the .htpasswd file
SOLUTION:
shell> cd tungsten-dashboard-dockershell> sudo htpasswd -c etc/.htpasswd tungstenERROR DETAILS:
shell> sudo docker logs dashboard[Tue Jun 15 19:37:23.074342 2021] [authn_file:error] [pid 20] (2)No such file or directory: [client 222.33.44.55:63370] AH01620: Could not open password file: /var/www/html/etc/.htpasswdCOMMAND:
sudo docker-compose upERROR:
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
CAUSE:
Docker server process not running
SOLUTION:
Start the Docker server process