If you already set up Db2® Warehouse on a Windows or Macintosh system but need to redeploy it, you must
first take steps to preserve your data and configurations.
Before you begin
If you are using the Docker for Windows or Docker for
Mac app, ensure that it is running.
Ensure that your Windows or Mac system meets the prerequisites described in Getting container images.
About this task
This task requires administrative authority.
How you perform this task depends on which installation method you use:
- If you installed the Docker for Mac app, perform the following steps from the terminal.
- If you are using the Docker for Windows app, perform
the following steps in the Windows PowerShell in admin
mode.
- If you installed Docker Toolbox instead of one of those apps, perform the following steps from
the Docker CLI prompt, which you obtain by using the Docker Quickstart Terminal desktop
shortcut.
Procedure
-
Clear your browser cache.
-
Log in to Docker by using your API key:
echo <apikey> | docker login -u iamapikey --password-stdin icr.io
where
<apikey> is the API key that you created as a prerequisite in
Getting container images.
-
Stop the Db2 Warehouse services by issuing the
following command:
docker exec -it Db2wh stop
-
Stop the Db2 Warehouse container by issuing the
following command:
- Optional:
If there is any data, including user accounts, that you want to have in your new deployment,
save that data in a safe place such as a tar file.
-
Remove the container by issuing the following command:
-
Remove the contents of the db2wh_vol volume by issuing the following
command:
Important: This step results in data loss, so ensure that you backed
up any data that you want to preserve, as described in step
5.
docker volume rm db2wh_vol
-
Sometimes, the Docker engine does not release all its resources, such as UNIX sockets, and this can result in a port-availability check failure during
redeployment. To avoid this, perform the following steps as the administrator.
- Delete the Docker network by issuing the following command:
docker network rm db2wh_net
- If you are using the Docker for Windows or Docker for
Mac app, restart Docker as follows:
- Right-click the whale icon.
- Click Quit Docker.
- Restart the Docker engine by clicking the Docker for Mac or Docker for Windows app.
- If you are using Docker Toolbox, restart the docker-machine VM by issuing the following
command:
docker-machine restart default
-
Create a network by issuing the following command:
docker network create db2wh_net
-
Re-create the containers:
- Pull, create, and initialize the Db2 Warehouse
container by issuing a docker run command.
The basic docker run command
is:
docker run -itd -p 8443:8443 -p 50000-50001:50000-50001 --net=db2wh_net --privileged=true --name=Db2wh -v db2wh_vol:/mnt/bludata0 -v db2wh_vol:/mnt/blumeta0 <tag>
where
<tag> represents the following value:
- Check the status of the redeployment by issuing the following
command:
docker logs --follow Db2wh
After the deployment finishes, you should
see a message that tells you that you successfully deployed Db2 Warehouse, along with the console URL and login
information.
- Exit the Docker logs by pressing Ctrl+C.
- If the port availability check fails even though you performed step 8, perform the following steps:
- Remove the container by issuing the following
command:
docker rm -f Db2wh
- Remove the contents of the db2wh_vol volume by issuing the following
command:
docker volume rm db2wh_vol
- Delete the Docker network by issuing the following command:
docker network rm db2wh_net
- Restart step 10 from the beginning.
-
Log in to the web console by using https://localhost:8443.