Support Questions
Find answers, ask questions, and share your expertise

How to set up a reverse proxy for Cloudera Manager

How to set up a reverse proxy for Cloudera Manager

Explorer

My Cloudera Manager server just has a private IP, but I want to access the web UI from anywhere, so I launch a apache server with a public IP, and configure a reverse proxy as follows:

 

ProxyRequests Off
ProxyPass /cmf http://172.18.84.158:7180/cmf
ProxyPassReverse /cmf http://172.18.84.158:7180/cmf
ProxyPass /static http://172.18.84.158:7180/static
ProxyPassReverse /static http://172.18.84.158:7180/static
ProxyPass /j_spring_security_check http://172.18.84.158:7180/j_spring_security_check
ProxyPassReverse /j_spring_security_check http://172.18.84.158:7180/j_spring_security_check

 

It works, but with a flaw, all charts can not display, on the home page, there are just blank rectangles.

 

Any ideas?

 

 

8 REPLIES 8

Re: How to set up a reverse proxy for Cloudera Manager

Explorer

By the way, I used the following configuration too, 

 

ProxyRequests Off
ProxyPass /http://172.18.84.158:7180/
ProxyPassReverse /http://172.18.84.158:7180/

 

Still the same problem, all charts don't dispaly

 

 

Re: How to set up a reverse proxy for Cloudera Manager

Explorer

I used Chrome's development tool, and saw the following error:

 

Problem accessing /cmf/charts/timeSeries. Reason:

Invalid request

Re: How to set up a reverse proxy for Cloudera Manager

Explorer

I use  Nginx as a reverse proxy, and it works, here is my configuration

 

server {
    listen 80;
    server_name public-ip;
    location / {
        proxy_pass http://172.18.84.158:7180;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;
        proxy_buffering off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

 

But I still want to figure out why apache dosen't work, hope there are someone to answer my questions, many thanks:)

Re: How to set up a reverse proxy for Cloudera Manager

About Apache, we did it like this http://gethue.com/i-put-a-proxy-on-hue/.
Does it help?

romain

Re: How to set up a reverse proxy for Cloudera Manager

Explorer

Thanks for you reply, but it dosen't fix the blank charts problem

Re: How to set up a reverse proxy for Cloudera Manager

New Contributor

I know this is an old post but I believe you can fix this issue by adding:

 

ProxyPreserveHost On

 

to your apache vhost.

 

Hopefully this will help others :)

Re: How to set up a reverse proxy for Cloudera Manager

New Contributor

Along with the ProxyPreserveHost option, I had to also set:

 

    Header unset X-Content-Type-Options

in order to get the UI widgets to resolve correctly, otherwise Chrome wouldn't translate the backend UI names to human readable.  Adding this option enables Chrome to sniff the content type again for some of the JSON data coming back from /cmf/resources/en/ui endpoint for CM 5.4.1.

 

I'm not sure if this is required for newer versions of CM.

Re: How to set up a reverse proxy for Cloudera Manager

Explorer

I got the charts to work by disabling the beans for CSRF interceptor. This may not be the best for security but for out installation our cluster is in its own network and not accessible from outside. 

 

1) Make backup of xml config file
cp /usr/share/cmf/webapp/WEB-INF/spring/mvc-config.xml /usr/share/cmf/webapp/WEB-INF/spring/mvc-config.xml.backup

 

2) Comment out this line in the config:
before:
<bean class="com.cloudera.server.web.cmf.csrf.CsrfRefererInterceptor" />

after:
<!-- bean class="com.cloudera.server.web.cmf.csrf.CsrfRefererInterceptor" / -->

 

3) Restart Cloudera Manager Server
service cloudera-scm-server restart

 

I hope that helps.