由于环境问题,我们在搭建完dashboard后重启httpd服务,会发生httpd超时的问题,在这里我为大家做个解答。
首先,关于这个问题的原因是由于启动httpd服务的时候他会首先执行以下两个命令:
/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear -v0
/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force -v0
在下面图可以看到在第二个图中第二个命令被杀掉了,所以失败了
这两个命令一个是收集一个是压缩的意思,想更多了解可以百度这里就不多说。
解决:
sed -i 's/5min/20min/g' /usr/lib /systemd/system/httpd.service.d/openstack-dashboard.conf
执行这条命令之后重启服务就OK啦!
以下是我查看和重启的过程。很简单的步骤
[[email protected] ~]# systemctl cat httpd
# /usr/lib/systemd/system/httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
# /usr/lib/systemd/system/httpd.service.d/openstack-dashboard.conf
[Service]
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear -v0
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force -v0
TimeoutStartSec=5min
[Unit]
After=memcached.service
[[email protected]~]#sed -i 's/5min/20min/g' /usr/lib/systemd/system/httpd.service.d/openstack-dashboard.conf
[[email protected]~]# cat /usr/lib/systemd/system/httpd.service.d/openstack-dashboard.conf
[Service]
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear -v0
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force -v0
TimeoutStartSec=20min
[Unit]
After=memcached.service
成功了