Ubuntu 12.04起搏器集群在php.ini中添加ioncube zend加载程序后无法加载Apache


Ubuntu 12.04 pacemaker cluster fails to load Apache after adding ioncube zend loader to php.ini

我已经配置了一个集群,除非在php.ini文件中添加zend扩展名,否则它可以正常运行。在我的测试中,我关闭了故障转移服务器,所以我只处理一台服务器。我运行的是Ubuntu 12.04、corosync 1.4.2和drbd 8.4.3以下是我的相关crm配置:

primitive apache2 ocf:heartbeat:apache '
        params configfile="/etc/apache2/apache2.conf" httpd="/usr/sbin/apache2" '
        operations $id="apache2-operations" '
        op monitor interval="15s" '
        op start interval="0" timeout="240s" '
        op stop interval="0" timeout="240s" '
        meta target-role="started"

我的php.ini是使用apt-get安装的常用php.ini在这种情况下,它运行良好。

但是,当我将zend加载添加到/etc/php5/apache2/php.ini时:

zend_extension = /var/www/ioncube/ioncube_loader_lin_5.3.so

我可以运行服务apache重启和网站但如果我尝试从crm启动它,它会失败,并显示以下日志:

    Apr 17 23:16:23 lzc1 lrmd: [1048]: WARN: Managed apache2:start process 2675 exited with return code 1.
    Apr 17 23:16:23 lzc1 lrmd: [1048]: info: operation start[31] on apache2 for client 1051: pid 2675 exited with return code 1
    Apr 17 23:16:23 lzc1 crmd: [1051]: info: process_lrm_event: LRM operation apache2_start_0 (call=31, rc=1, cib-update=42, confirmed=true) unknown error
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_ais_dispatch: Update relayed from lzc2
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_trigger_update: Sending flush op to all hosts for: fail-count-apache2 (INFINITY)
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_perform_update: Sent update 53: fail-count-apache2=INFINITY
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_ais_dispatch: Update relayed from lzc2
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_trigger_update: Sending flush op to all hosts for: last-failure-apache2 (1397790983)
    Apr 17 23:16:23 lzc1 attrd: [1049]: notice: attrd_perform_update: Sent update 55: last-failure-apache2=1397790983
    Apr 17 23:16:23 lzc1 crmd: [1051]: info: do_lrm_rsc_op: Performing key=6:102:0:c4a37f0f-2071-433e-83a3-50fb5d9e0ad2 op=apache2_stop_0 )
    Apr 17 23:16:23 lzc1 lrmd: [1048]: info: rsc:apache2 stop[32] (pid 2782)
    Apr 17 23:16:23 lzc1 apache[2782]: INFO: apache is not running.
    Apr 17 23:16:23 lzc1 lrmd: [1048]: info: Managed apache2:stop process 2782 exited with return code 0.
    Apr 17 23:16:23 lzc1 lrmd: [1048]: info: operation stop[32] on apache2 for client 1051: pid 2782 exited with return code 0
    Apr 17 23:16:23 lzc1 crmd: [1051]: info: process_lrm_event: LRM operation apache2_stop_0 (call=32, rc=0, cib-update=43, confirmed=true) ok
    Apr 17 23:16:24 lzc1 lrmd: [1048]: info: operation monitor[22] on res_IPaddr2_ClusterIP for client 1051: pid 2847 exited with return code 0

如果我注释掉/etc/php5/apache2/php.ini 中的zend行

;zend_extension = /var/www/ioncube/ioncube_loader_lin_5.3.so

然后启动服务器,它就工作了。以下是它工作时的日志:

Apr 17 23:20:10 lzc1 crmd: [1051]: info: do_lrm_rsc_op: Performing key=76:107:0:c4a37f0f-2071-433e-83a3-50fb5d9e0ad2 op=apache2_start_0 )
Apr 17 23:20:10 lzc1 lrmd: [1048]: info: rsc:apache2 start[37] (pid 12579)
Apr 17 23:20:10 lzc1 cib: [1047]: info: Managed write_cib_contents process 12578 exited with return code 0.
Apr 17 23:20:10 lzc1 apache[12579]: INFO: apache not running
Apr 17 23:20:10 lzc1 apache[12579]: INFO: waiting for apache /etc/apache2/apache2.conf to come up
Apr 17 23:20:11 lzc1 lrmd: [1048]: info: Managed apache2:start process 12579 exited with return code 0.
Apr 17 23:20:11 lzc1 lrmd: [1048]: info: operation start[37] on apache2 for client 1051: pid 12579 exited with return code 0
Apr 17 23:20:11 lzc1 crmd: [1051]: info: process_lrm_event: LRM operation apache2_start_0 (call=37, rc=0, cib-update=53, confirmed=true) ok
Apr 17 23:20:11 lzc1 crmd: [1051]: info: do_lrm_rsc_op: Performing key=77:107:0:c4a37f0f-2071-433e-83a3-50fb5d9e0ad2 op=apache2_monitor_15000 )
Apr 17 23:20:11 lzc1 lrmd: [1048]: info: rsc:apache2 monitor[38] (pid 12673)
Apr 17 23:20:11 lzc1 lrmd: [1048]: info: Managed apache2:monitor process 12673 exited with return code 0.
Apr 17 23:20:11 lzc1 lrmd: [1048]: info: operation monitor[38] on apache2 for client 1051: pid 12673 exited with return code 0
Apr 17 23:20:11 lzc1 crmd: [1051]: info: process_lrm_event: LRM operation apache2_monitor_15000 (call=38, rc=0, cib-update=54, confirmed=false) ok

我不知道为什么,但这解决了问题。从ssh控制台:

export OCF_ROOT=/usr/lib/ocf
export OCF_RESKEY_configfile="/etc/apache2/apache2.conf" httpd="/usr/sbin/apache2" statusurl="http://127.0.0.1/server-status" envfiles="/etc/apache2/envvars"
/usr/lib/ocf/resource.d/heartbeat/apache start
/usr/lib/ocf/resource.d/heartbeat/apache stop
crm resource manage apache2

也许它以前没有"管理"过?