Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion charts/accumulo/templates/accumulo-manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ spec:
INSTANCE_EXISTS=false

# Use ListInstances to check ZooKeeper (works with Java 17)
if /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "{{ .Values.accumulo.instance.name }}"; then
# Match instance name with quotes to avoid false positives from ZooKeeper hostname
if /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"{{ .Values.accumulo.instance.name }}\""; then
echo "✓ Accumulo instance '{{ .Values.accumulo.instance.name }}' already exists in ZooKeeper"
INSTANCE_EXISTS=true

Expand Down
27 changes: 10 additions & 17 deletions charts/accumulo/templates/alluxio-worker-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,15 @@ spec:
sleep 5
done

# Set worker hostname to FQDN for Kubernetes DNS resolution
WORKER_FQDN="${POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${POD_NAMESPACE}.svc.cluster.local"
echo "Setting Alluxio worker hostname to: ${WORKER_FQDN}"
# Worker hostname is set via ALLUXIO_WORKER_HOSTNAME environment variable
echo "Alluxio worker hostname: ${ALLUXIO_WORKER_HOSTNAME}"
echo "Alluxio job worker hostname: ${ALLUXIO_JOB_WORKER_HOSTNAME}"

# Export as environment variables for Alluxio to pick up
export ALLUXIO_WORKER_HOSTNAME="${WORKER_FQDN}"
export ALLUXIO_JOB_WORKER_HOSTNAME="${WORKER_FQDN}"

# Add to alluxio-site.properties dynamically
cat >> /opt/alluxio/conf/alluxio-site.properties <<EOF
alluxio.worker.hostname=${WORKER_FQDN}
alluxio.job.worker.hostname=${WORKER_FQDN}
EOF

# Create directories
mkdir -p /opt/ramdisk
mkdir -p /opt/alluxio/logs

# Mount ramdisk for memory tier
mount -t tmpfs -o size={{ .Values.alluxio.properties.alluxio.worker.memory.size }} tmpfs /opt/ramdisk
# Note: /opt/ramdisk is already mounted as emptyDir with medium: Memory
# No need to manually mount tmpfs

# Start worker
/opt/alluxio/bin/alluxio-start.sh worker
Expand Down Expand Up @@ -134,6 +123,10 @@ EOF
fieldPath: metadata.namespace
- name: ALLUXIO_MASTER_HOSTNAME
value: {{include "accumulo.fullname" .}}-alluxio-master
- name: ALLUXIO_WORKER_HOSTNAME
value: "$(POD_NAME).{{ include "accumulo.fullname" . }}-alluxio-worker.$(POD_NAMESPACE).svc.cluster.local"
- name: ALLUXIO_JOB_WORKER_HOSTNAME
value: "$(POD_NAME).{{ include "accumulo.fullname" . }}-alluxio-worker.$(POD_NAMESPACE).svc.cluster.local"
{{- if eq .Values.storage.provider "s3" }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
Expand Down Expand Up @@ -173,7 +166,7 @@ EOF
resources:
{{- toYaml .Values.alluxio.worker.resources | nindent 10 }}
securityContext:
privileged: true # Required for mounting tmpfs
privileged: false
livenessProbe:
httpGet:
path: /
Expand Down
6 changes: 3 additions & 3 deletions charts/accumulo/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ data:
alluxio-site.properties: |
# Alluxio configuration for Accumulo storage (Worker)
## Worker configuration
alluxio.master.hostname={{ include "accumulo.fullname" . }}-alluxio-master
alluxio.master.rpc.port=19998
alluxio.master.web.port=19999
#alluxio.master.hostname={{ include "accumulo.fullname" . }}-alluxio-master
#alluxio.master.rpc.port=19998
#alluxio.master.web.port=19999
# Worker hostname will be set via ALLUXIO_WORKER_HOSTNAME environment variable in deployment
alluxio.worker.bind.host=0.0.0.0
alluxio.worker.port=29999
Expand Down
3 changes: 2 additions & 1 deletion docker/accumulo/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ init_accumulo() {
wait_for_service "$zk_host" "$zk_port" "ZooKeeper"

# Check if instance already exists
if "$ACCUMULO_HOME"/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "$ACCUMULO_INSTANCE_NAME"; then
# Match instance name with quotes to avoid false positives from ZooKeeper hostname
if "$ACCUMULO_HOME"/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"$ACCUMULO_INSTANCE_NAME\""; then
echo "Accumulo instance '$ACCUMULO_INSTANCE_NAME' already exists"
else
echo "Initializing Accumulo instance '$ACCUMULO_INSTANCE_NAME'..."
Expand Down
3 changes: 2 additions & 1 deletion scripts/validate-accumulo-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ check_accumulo_init() {
fi

# Check if instance exists in ZooKeeper
if kubectl exec -n "$NAMESPACE" "$MANAGER_POD" -- /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "$INSTANCE_NAME"; then
# Match instance name with quotes to avoid false positives from ZooKeeper hostname
if kubectl exec -n "$NAMESPACE" "$MANAGER_POD" -- /opt/accumulo/bin/accumulo org.apache.accumulo.server.util.ListInstances 2>/dev/null | grep -q "\"$INSTANCE_NAME\""; then
validate_check "Accumulo instance '$INSTANCE_NAME' exists in ZooKeeper" "pass"
else
validate_check "Accumulo instance '$INSTANCE_NAME' NOT found in ZooKeeper" "fail"
Expand Down