You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kreuser, Peter" <pk...@airplus.com> on 2016/10/12 15:17:58 UTC
Mod_jk 1.2.42 fails at startup with shared memory failure
Hi all, Hi Mark,
I see one change in the newest mod_jk (see below), that stops Apache in my configuration:
The discussion on this bug is valid https://bz.apache.org/bugzilla/show_bug.cgi?id=59184, however I would like to see an explanation o why the shm may fail!
Docker 1.12
Debian Stretch with Apache 2.4.23
Mod_jk 1.2.42 compiled from source
JK Conf without directives for JkShmFile, JKShmSize (standard values).
Apparently Mod_jk 1.2.42 fails at startup if something goes wrong with shared memory. If I revert to 1.2.41 apache starts and I only see the older message in the jk_log. Note that I don't need real loadbalancing, as I have only one worker. If I understood the conf correctly I still have a balancer with 1 worker, right?
[Wed Oct 12 16:26:28.326947 2016] [jk:emerg] [pid 7] Initializing shm:/etc/apache2/logs/jk-runtime-status.7 errno=22. Unable to start due to shared memory failure. (errno=22 is Invalid Param in jk_shm_open)
[Wed Oct 12 16:26:28.327012 2016] [jk:emerg] [pid 7] Initializing shm:/etc/apache2/logs/jk-runtime-status.7 errno=22. Unable to start due to shared memory failure. (errno=22 is Invalid Param in jk_shm_open)
Any idea and hints? Thank You.
Best regards
Peter
3572<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3572>
if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) == 0) {
3573<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3573>
apr_pool_cleanup_register(pconf, conf->log,
3574<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3574>
jk_cleanup_proc,
3575<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3575>
apr_pool_cleanup_null);
3576<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3576>
}
3577<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3577>
else {
3578<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3578>
jk_error_exit(JKLOG_MARK, APLOG_EMERG, s, s->process->pool,
3579<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3579>
"Initializing shm:%s errno=%d. Unable to start due to shared memory failure.",
3580<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3580>
jk_shm_name(), rc);
3581<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3581>
}
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=diff&r1=1761418&r2=1761419&pathrev=1761419
--- tomcat/jk/trunk/native/apache-2.0/mod_jk.c 2016/09/19 10:18:12 1761418
+++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c 2016/09/19 10:23:46 1761419
@@ -3575,9 +3575,9 @@
apr_pool_cleanup_null);
}
else {
- jk_log(conf->log, JK_LOG_ERROR,
- "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
- jk_shm_name(), rc);
+ jk_error_exit(JKLOG_MARK, APLOG_EMERG, s, s->process->pool,
+ "Initializing shm:%s errno=%d. Unable to start due to shared memory failure.",
+ jk_shm_name(), rc);
}
/* we add the URI->WORKER MAP since workers using AJP14
will feed it */
Re: Mod_jk 1.2.42 fails at startup with shared memory failure
Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 12.10.2016 17:17, Kreuser, Peter wrote:
> Hi all, Hi Mark,
>
> I see one change in the newest mod_jk (see below), that stops Apache in my configuration:
>
> The discussion on this bug is valid https://bz.apache.org/bugzilla/show_bug.cgi?id=59184, however I would like to see an explanation o why the shm may fail!
>
> Docker 1.12
>
> Debian Stretch with Apache 2.4.23
> Mod_jk 1.2.42 compiled from source
>
> JK Conf without directives for JkShmFile, JKShmSize (standard values).
>
> Apparently Mod_jk 1.2.42 fails at startup if something goes wrong with shared memory. If I revert to 1.2.41 apache starts and I only see the older message in the jk_log. Note that I don't need real loadbalancing, as I have only one worker. If I understood the conf correctly I still have a balancer with 1 worker, right?
>
Not necessarily, it depends on how you have configured this.
case a)
If your configuration says :
worker.list=balancer
..
worker1.type=ajp13
..
balancer.type=lb
balancer.balance_workers=worker1
then yes, you have a balancer which "balances" only 1 worker (worker1).
case b)
If your configuration says :
workers.list=worker1
worker1.type=ajp13
..
then you have only 1 "real" AJP worker, and it is not "balanced".
> [Wed Oct 12 16:26:28.326947 2016] [jk:emerg] [pid 7] Initializing shm:/etc/apache2/logs/jk-runtime-status.7 errno=22. Unable to start due to shared memory failure. (errno=22 is Invalid Param in jk_shm_open)
> [Wed Oct 12 16:26:28.327012 2016] [jk:emerg] [pid 7] Initializing shm:/etc/apache2/logs/jk-runtime-status.7 errno=22. Unable to start due to shared memory failure. (errno=22 is Invalid Param in jk_shm_open)
>
>
> Any idea and hints? Thank You.
>
> Best regards
>
> Peter
>
> 3572<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3572>
>
> if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) == 0) {
>
> 3573<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3573>
>
> apr_pool_cleanup_register(pconf, conf->log,
>
> 3574<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3574>
>
> jk_cleanup_proc,
>
> 3575<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3575>
>
> apr_pool_cleanup_null);
>
> 3576<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3576>
>
> }
>
> 3577<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3577>
>
> else {
>
> 3578<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3578>
>
> jk_error_exit(JKLOG_MARK, APLOG_EMERG, s, s->process->pool,
>
> 3579<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3579>
>
> "Initializing shm:%s errno=%d. Unable to start due to shared memory failure.",
>
> 3580<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3580>
>
> jk_shm_name(), rc);
>
> 3581<http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=markup#l3581>
>
> }
>
>
>
> http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?view=diff&r1=1761418&r2=1761419&pathrev=1761419
>
>
>
> --- tomcat/jk/trunk/native/apache-2.0/mod_jk.c 2016/09/19 10:18:12 1761418
>
> +++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c 2016/09/19 10:23:46 1761419
>
> @@ -3575,9 +3575,9 @@
>
> apr_pool_cleanup_null);
>
> }
>
> else {
>
> - jk_log(conf->log, JK_LOG_ERROR,
>
> - "Initializing shm:%s errno=%d. Load balancing workers will not function properly.",
>
> - jk_shm_name(), rc);
>
> + jk_error_exit(JKLOG_MARK, APLOG_EMERG, s, s->process->pool,
>
> + "Initializing shm:%s errno=%d. Unable to start due to shared memory failure.",
>
> + jk_shm_name(), rc);
>
> }
>
> /* we add the URI->WORKER MAP since workers using AJP14
>
> will feed it */
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org