5

I have an EMR cluster

response = emr_client.run_job_flow(
    Name="Test dashboards",
    ReleaseLabel='emr-6.2.0',
    LogUri=f"s3://my-bucket/emr_logs/",
    Instances={
        'MasterInstanceType': 'm6g.2xlarge',
        'SlaveInstanceType': 'm6g.2xlarge',
        'InstanceCount': 2,
        'KeepJobFlowAliveWhenNoSteps': True,
        'TerminationProtected': False,
        'Ec2SubnetId': emr_config['Instances']['Ec2SubnetId'],
        'AdditionalMasterSecurityGroups': emr_config['Instances']['AdditionalMasterSecurityGroups']
    },
    VisibleToAllUsers=True,
    JobFlowRole=emr_config['JobFlowRole'],
    ServiceRole=emr_config['ServiceRole'],
    StepConcurrencyLevel=1,
    Applications=[
        {"Name":"Spark"},
        {"Name": "JupyterHub"},
        {"Name": "Ganglia"}
    ]
)

When I want to view the dashboards it works ok for jupyterhub/Yarn resource manager/... (i.e.

  • http://master-public-dns-name:8088/
  • https://master-public-dns-name:9433/

but when I try to access Ganglia http://master-public-dns-name/ganglia I am getting 403 Forbidden.

Is there any extra setup required?

redacted
  • 3,789
  • 6
  • 25
  • 38

1 Answers1

9

E: Know issue but still not fixed in EMR 6.3.0

sshing to the master node and running

sudo service httpd reload

fixes the issue (thanks to @Aleksey!). E: Initially I thought the steps described in this answer) are necessary which is not true.

The gotcha here is that you can't just put this to a bootstrap script because they are executed before software is installed on the cluster. Drawing from this answer you can create a shell script s3://my-bucket/fix_ganglia.sh

if [ -f "/etc/httpd/conf.d/ganglia.conf" ]; then
    echo "Setting up ganglia on master node"
    sudo sed -i 's/Order deny,allow/#Order deny,allow/g' /etc/httpd/conf.d/ganglia.conf
    sudo service httpd reload
fi

and configure it as a step with script-runner.jar

Steps = [{
    'Name': 'Fix Ganglia access',
    'ActionOnFailure': 'CONTINUE',
    'HadoopJarStep': {
        'Jar': 's3://ap-southeast-1.elasticmapreduce/libs/script-runner/script-runner.jar',
        'Args': ['s3://my-bucket/fix_ganglia.sh']
    }
}]

and this should work.

redacted
  • 3,789
  • 6
  • 25
  • 38