To start Ozone in Kubernetes, you need Kubernetes and kubectl installed. You also need to add the flekszible binary in your path.
mvn clean install -DskipShade -DskipTests
cd <ozone-root>/hadoop-ozone/dist/target/ozone-X.X../kubernetes/examples/ozone
source ../testlib.sh
regenerate_resources
Select some preferred ports for attaching the debugger. Below there is an example configuration for connecting OM to port 5005, SCM to port 6006 and S3G to port 7007.
Run -> Edit Configurations... -> Add New Configuration -> Remote JVM Debug
om-0
, Debugger mode: Attach to remote JVM
, Host: localhost
, Port: 5005
scm-0
, Debugger mode: Attach to remote JVM
, Host: localhost
, Port: 6006
s3g-0
, Debugger mode: Attach to remote JVM
, Host: localhost
, Port: 7007
Update Ozone startup to use the preferred ports, as follows:
In the file <ozone-root>/hadoop-ozone/dist/target/ozone-X.X../bin/ozone
OZONE_OM_OPTS="${RATIS_OPTS} ${OZONE_OM_OPTS}"
with OZONE_OM_OPTS="${RATIS_OPTS} ${OZONE_OM_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
OZONE_SCM_OPTS="${RATIS_OPTS} ${OZONE_SCM_OPTS}"
with OZONE_SCM_OPTS="${RATIS_OPTS} ${OZONE_SCM_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:6006"
ozone-s3gateway
add OZONE_S3G_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7007"
sudo k3s server
cd <ozone-root>/hadoop-ozone/dist/target/ozone-X.X../kubernetes/examples/ozone
kubectl apply -f .
kubectl get pods
kubectl port-forward om-0 5005:5005 & kubectl port-forward scm-0 6006:6006 & kubectl port-forward s3g-0 7007:7007 &
kubectl exec -it scm-0 bash ozone sh volume create testVolume