2016-03-17 23:37:38
来 源
中存储
Openstack
现在来看openstack里NOVNC WEB访问配置,• 编辑/etc/nova/nova.conf文件,添加如下内容:将NOVNC执行程序添加到环境变量中。

目录   上一篇   下一篇

3.19 NOVNC WEB访问配置

·         编辑/etc/nova/nova.conf文件,添加如下内容:

novncproxy_base_url=http://$my_ip:6080/vnc_auto.html

vnc_enabled=true

vnc_keymap=en-us

vncserver_listen=$my_ip

vncserver_proxyclient_address=$my_ip

·         NOVNC执行程序添加到环境变量中

ln -sv /opt/noVNC/utils/nova-novncproxy /usr/bin/

·         /etc/init.d/下建立名为nova-novncproxyNOVNC服务启动脚本,内容如下:

#!/bin/sh

#

# openstack-nova-novncproxy  OpenStack Nova VNC Web Console

#

# chkconfig:   - 20 80

# description: OpenStack Nova VNC Web Console

 

### BEGIN INIT INFO

# Provides:

# Required-Start: $remote_fs $network $syslog

# Required-Stop: $remote_fs $syslog

# Default-Stop: 0 1 6

# Short-Description: OpenStack Nova VNC Web Console

# Description: OpenStack Nova VNC Web Console

### END INIT INFO

 

. /etc/rc.d/init.d/functions

 

suffix=novncproxy

prog=openstack-nova-$suffix

web="/opt/noVNC"

exec="/usr/bin/nova-$suffix"

config="/etc/nova/nova.conf"

pidfile="/var/run/nova/nova-$suffix.pid"

logfile="/var/log/nova/$suffix.log"

 

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

 

lockfile=/var/lock/nova/$prog

 

start() {

    [ -x $exec ] || exit 5

    [ -f $config ] || exit 6

    echo -n $"Starting $prog: "

    daemon --user nova --pidfile $pidfile "$exec --config-file=$config --web $web --logfile=$logfile --daemon &>/dev/null & echo $! > $pidfile"

    retval=$?

    echo

    [ $retval -eq 0 ] && touch $lockfile

    return $retval

}

 

stop() {

    echo -n $"Stopping $prog: "

    killproc -p $pidfile $prog

    retval=$?

    echo

    [ $retval -eq 0 ] && rm -f $lockfile

    return $retval

}

 

restart() {

    stop

    start

}

 

reload() {

    restart

}

 

force_reload() {

    restart

}

 

rh_status() {

    status -p $pidfile $prog

}

 

rh_status_q() {

    rh_status >/dev/null 2>&1

}

 

case "$1" in

    start)

        rh_status_q && exit 0

        $1

        ;;

    stop)

        rh_status_q || exit 0

        $1

        ;;

    restart)

        $1

        ;;

    reload)

        rh_status_q || exit 7

        $1

        ;;

    force-reload)

        force_reload

        ;;

    status)

        rh_status

        ;;

    condrestart|try-restart)

        rh_status_q || exit 0

        restart

        ;;

    *)

        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"

        exit 2

esac

exit $?

·         /etc/init.d/下建立名为nova-consoleauth的控制台认证启动脚本,内容如下:

#!/bin/sh

#

# openstack-nova-novncproxy  OpenStack Nova Console Auth

#

# chkconfig:   - 20 80

# description: OpenStack Nova Console Auth

 

### BEGIN INIT INFO

# Provides:

# Required-Start: $remote_fs $network $syslog

# Required-Stop: $remote_fs $syslog

# Default-Stop: 0 1 6

# Short-Description: OpenStack Nova Console Auth

# Description: OpenStack Nova Console Auth

### END INIT INFO

 

. /etc/rc.d/init.d/functions

 

suffix=consoleauth

prog=openstack-nova-$suffix

exec="/usr/bin/nova-$suffix"

config="/etc/nova/nova.conf"

pidfile="/var/run/nova/nova-$suffix.pid"

logfile="/var/log/nova/$suffix.log"

 

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

 

lockfile=/var/lock/nova/$prog

 

start() {

    [ -x $exec ] || exit 5

    [ -f $config ] || exit 6

    echo -n $"Starting $prog: "

    daemon --user nova --pidfile $pidfile "$exec --config-file=$config --logfile=$logfile &>/dev/null & echo $! > $pidfile"

    retval=$?

    echo

    [ $retval -eq 0 ] && touch $lockfile

    return $retval

}

 

stop() {

    echo -n $"Stopping $prog: "

    killproc -p $pidfile $prog

    retval=$?

    echo

    [ $retval -eq 0 ] && rm -f $lockfile

    return $retval

}

 

restart() {

    stop

    start

}

 

reload() {

    restart

}

 

force_reload() {

    restart

}

 

rh_status() {

    status -p $pidfile $prog

}

 

rh_status_q() {

    rh_status >/dev/null 2>&1

}

 

case "$1" in

    start)

        rh_status_q && exit 0

        $1

        ;;

    stop)

        rh_status_q || exit 0

        $1

        ;;

    restart)

        $1

        ;;

    reload)

        rh_status_q || exit 7

        $1

        ;;

    force-reload)

        force_reload

        ;;

    status)

        rh_status

        ;;

    condrestart|try-restart)

        rh_status_q || exit 0

        restart

        ;;

    *)

        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"

        exit 2

esac

exit $?

·         配置启动脚本

chmod 755 /etc/init.d/nova-novncproxy

chmod 755 /etc/init.d/nova-consoleauth

·         启动GLANCE-APIGLANCE-REGISTRY服务

/etc/init.d/nova-novncproxy start

/etc/init.d/nova-consoleauth start

·         检测服务是否正常启动

 

通过netstat -ltunp查看是否有tcp 6080端口监听
如果没有正常启动请查看/var/log/nova目录下相关文件排错

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。