-
Notifications
You must be signed in to change notification settings - Fork 6
docker
flm003 edited this page Feb 9, 2017
·
4 revisions
- Currently only in dev-env branch
- HRDBMS nodes are wrapped in Docker containers
- Debugging can be done in any environment (Linux, Windows, etc)
- Tested with Docker version: 1.13; Docker composer: 1.10
- Tested with Java version: 1.8.0_101 (already pushed into docker image)
- Tested with IDE: IntelliJ IDEA 2016.2.5 (free student subscription)
- Native IDEA Build (used for debugging)
- Build -> Make Project (Ctrl + F9)
- Result is bin directory as shown on the screenshot
- We can lauch executable from bin directory such coordinator, worker, and cli
- IDEA Plugins: ANTLR v4 grammar plugin, IvyIDEA
- Ant build
- clean
- createParser (autogenerated code)
- createJar
- Open terminal and go to the docker folder of the project
- docker-compose.yml should be available in the folder
- Run docker-compose down (We do not need to run the command if docker containers are not launched yet)
- Run docker-compose up -d
- Note: if your host OS has SELinux enabled, the docker container will not be able to see the /home/hrdbms/app volume. Append :z to the volumes in the docker-compose.yml to remedy
- Docker Toolbox+Oracle VM Virtual Box have to be installed
- VM should have sufficient amount of memory (launch is possible when RAM = 8 Gb)
- Open Oracle VM VirtualBox Manager
- Open "Settings" for Docker host VM
- Open "Shared Folders"
- Remove all existing shares and add new one:
- Specify any path on Your PC (referenced further as [LOCAL_SHARED_PATH])
- Enter any name you will remember, e.g. "HRDBMS" (referenced further as [VM_SHARE_NAME])
- Create sub-directory under your [LOCAL_SHARED_PATH] for specified container, e.g. 'my-first-container' (referenced further as [CONTAINER_DIR])
- Start or attach to running Docker host VM (use "Start" or "Show" button respectively)
- Create new directory inside Docker host VM, e.g. /home/docker/hrdbms (referenced further as [DOCKER_HOST_PATH])
- sudo mkdir -p /home/docker/
- Mount [VM_SHARE_NAME] to [DOCKER_HOST_PATH] using 'mount -t vboxsf [VM_SHARE_NAME] [DOCKER_HOST_PATH]' command, e.g.
- sudo mount -t vboxsf -o defaults,uid=
id -u docker,gid=id -g dockerHRDBMS /home/docker/hrdbms - Create/Run Docker container with volume using '-v [DOCKER_HOST_PATH]/[CONTAINER_DIR]:[CONTAINER_SHARE_PATH] Now you have access to [LOCAL_SHARED_PATH]/[CONTAINER_DIR] inside your docker container using [CONTAINER_SHARE_PATH].
- docker-machine ssh
- docker run -it -d -v /home/docker/hrdbms:/home/hrdbms/app --name coordinator -p 5010:5010 mykh74/hrdbms:v2
- docker run -it -d -v /home/docker/hrdbms:/home/hrdbms/app --name worker -p 5015:5015 mykh74/hrdbms:v2
- ssh hrdbms@17.17.0.2 (we need to ssh to docker-machine first in Windows)
- password: hrdbms
- sh hrdbms_start.sh
- Instead of hrdmbs_start.sh we can run the following comand:
- nohup java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5010 -XX:+UseG1GC -XX:G1HeapRegionSize=2m -XX:+ParallelRefProcEnabled -XX:MaxDirectMemorySize=27772160000 -XX:+AggressiveOpts -classpath /home/hrdbms/app/build/HRDBMS.jar: com.exascale.managers.HRDBMSWorker 0 &
- Port 5010 is opened port for debugging by IDE
- Hrdbms client can be run locally or in docker containers:
- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Xmx1G -Xms1G -classpath /home/michael/ms-project/Bitbucket/hrdbms/HRDBMS/build/HRDBMS.jar: com.exascale.cli.CLI - local launch of CLI
- classpath should be local path to local bin folder of the project
- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Xmx1G -Xms1G -classpath /home/hrdbms/app/build/HRDBMS.jar: com.exascale.cli.CLI - launch of HRDBMS client in HRDBMS node
