MOF Deployment
1. Mount MOF into the Container via Volume
Add the parameter below when starting the container:
-v {location}/uavmof: {dockerLocation}/uavmof
wherein ‘{location}’ is the unzipped directory of MOF in the host and
{dockerLocation}
is the unzipped directory of MOF in Docker. The directory can be customized. /app/uav/ is recommended.Modify the configuration file by changing the data transmission mode into Http mode: Modify the property value of
com.creditease.uav.dataobserver.workmodel
in uav.properties intohttp
.Set MOFROOT path and javaagent parameters: The setting of MOFROOT and javaagent parameter is basically the same as that in the general environment except that
{location}
shall be changed into the MOF location in the container. Take Tomcat as an example. Add--env CATALINA_OPTS="-javaagent:{dockerLocation}/com.creditease.uav.agent/com.creditease.uav.monitorframework.agent-1.0-agent.jar”
to embed javaagent parameter when starting Tomcat with Docker. The setting of MOFROOT is completely the same as the General mode but remember to make sure that the location shall be within the Docker container.Check the container startup log to confirm whether MOF probe is successfully installed.
2. Build the MOF File into the Image via Dockerfile
- Unzip MOF under the directory at the same level as Dockerfile
- Modify the property value of
com.creditease.uav.dataobserver.workmodel
in uav.properties intohttp
- Add the statements below into Dockerfile:
ADD uavmof {dockerLocation}/uavmof
- Construct images with Dockerfile
- Set MOFROOT and javaagent parameters by following Step 3 and Step 4 in Method 1. Check logs to determine whether MOF is successfully installed.