4

I am doing clustering in Tomcat 7 with Apache server. It is working fine too. However I have the following issues:

1) I am trying to monitor the mod_jk status page; but it is giving 404 error.

2) in Log following error is shown -

[Tue Dec 17 13:16:51.019 2013] [2236:140599476504544] [error] init_jk::mod_jk.c (3348): Initializing shm:/etc/httpd/logs/mod_jk.shm.2236 errno=13. Load balancing workers will not function properly.
[Tue Dec 17 13:16:51.019 2013] [2236:140599476504544] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Tue Dec 17 13:16:51.041 2013] [2237:140599476504544] [error] init_jk::mod_jk.c (3348): Initializing shm:/etc/httpd/logs/mod_jk.shm.2237 errno=13. Load balancing workers will not function properly.
[Tue Dec 17 13:16:51.042 2013] [2237:140599476504544] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized

Here is worker.properties file

worker.list=tomcatnode1,tomcatnode2,loadbalancer,statusmanager

worker.tomcatnode1.port=8009
worker.tomcatnode1.host=localhost
worker.tomcatnode1.type=ajp13
worker.tomcatnode1.lbfactor=100

worker.tomcatnode2.port=8010
worker.tomcatnode2.host=localhost
worker.tomcatnode2.type=ajp13
worker.tomcatnode2.lbfactor=100


#Load Balance Configuration
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=tomcatnode1, tomcatnode2
worker.loadbalancer.sticky_session=1

#worker.list=jkstatus
worker.statusmanager.type=status

Here is mod_jk.conf file

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkShmFile logs/mod_jk.shm
JkMount /IntellixWebApi/* loadbalancer
#JkMount /jkmanager/* jkstatus
#JkMount /jkmanager jkstatus

<Location /status/>
    JkMount statusmanager
    Order deny,allow
#   Deny from all
    Allow from 127.0.0.1
</Location>

If I am accessing IntellixWebApi; it is accessable. but When I am using /status; it is not working.

Please suggest.

Kumar
  • 201
  • 3
  • 7

2 Answers2

4

There's a problem initializing the shared memory that is needed by the workers.

Check whether the directory /etc/httpd/logs/ exists and is writable by the user that's running the tomcat instance. If it isn't, either change the permissions on the directory, or create a separate directory to keep the shm files in. (I'd recommend the latter, simply because it's not a good idea to keep important state in the same place as your logs, for several reasons.)

If the directory does exist and is writable, check whether you've got SELinux on and if so whether there are any permissions issues with it. You could always try to set it to permissive to see whether the problem disappears; if so, it's time to fix the permissions and turn it back on.

Jenny D
  • 27,358
  • 21
  • 74
  • 110
  • What about the getting 404 error while checking the status of load balancer.??? – Kumar Dec 17 '13 at 09:13
  • Yes it exists and have all permission. – Kumar Dec 17 '13 at 09:15
  • I'd like to see some log entries referring to that problem in order to answer. But in either case, you need to fix the shm problem or your load balancing won't work. And it's not enough that the directory itself has the right permissions; `/etc` and `/etc/httpd` also need to have that. – Jenny D Dec 17 '13 at 09:16
  • Which log entry you want to see?? – Kumar Dec 17 '13 at 09:17
  • 2) in Log following error is shown - below is the log file content; Please check in the question...or you required any other log entry?? – Kumar Dec 17 '13 at 09:20
  • And that log is what I explained to you in my answer. – Jenny D Dec 17 '13 at 09:30
  • I had given all the /etc and /etc/httpd by giving all permission to user, group and others. – Kumar Dec 17 '13 at 09:40
  • I had also chnaged the SELINUX to permissive. But did not reboot the system. Getenforce is still showing enforcing. What to do?? – Kumar Dec 17 '13 at 09:42
  • I restarted my system and now SELINUX is in permissive mode. every thing working but not /status. – Kumar Dec 17 '13 at 10:11
  • What do your logs say now, then? – Jenny D Dec 18 '13 at 07:08
  • Now it is working...log says like Intialize .shm....etc.Thanks for your efforts – Kumar Dec 18 '13 at 07:14
1

After lots of googling; I am able to get the jk_manager status screen. Firstly I have disable the SELINUX and then after restarting the system; I set the following JkMount

JkMount /* loadbalancer
JkMount /IntellixWebApi/* loadbalancer
JkMount /jkmanager/* jkstatus

<Location /status/>
    JkMount statusmanager
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>

This worked for me.

Thanks

Kumar
  • 201
  • 3
  • 7