centos6.5通过devstack安装openstack juno

遇到的问题和解决办法

1.类似  xxxx is not in global-requirements.txt 问题

比如

     2015-04-25 08:34:28.440 | 'wsgiref' is not in global-requirements.txt

解决方法 :

找到openstack requirement project in https://github.com/openstack/requirements/tree/master,将 branch 切换到对应的 branch ,比如juno。 打开global-requirements.txt 文件,搜索wsgiref 可以看到wsgiref>=0.1.2,将这一行加到/opt/stack/requirements/global-requirements.txt:

 echo "wsgiref>=0.1.2" >> /opt/stack/requirements/global-requirements.txt

引起问题的原因,因为源码是git 的juno branch 但是运行devstak  /stack.sh的时候,会自动去git master的requirements 项目,branch 不匹配。

 2.提示没有python-mox

解决方法 :

下载安装mox:http://rpm.pbone.net/index.php3/stat/4/idpl/15288633/dir

/redhat_el_6/com/python-mox-0.5.3-2.el6.noarch.rpm.html

 3.q-agt服务无法启动

通过./rejoin-stack.sh查看q-agt信息看到:ContextualVersionConflict: (six 1.7.3 (/usr/lib/python2.6

/site-packages), Requirement.parse(\'six>=1.9.0\')

解决方法:

wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate

python get-pip.py

pip uninstall six

pip install six

Successfully installed six-1.9.0

4.q-dhcp服务无法启动

通过./rejoin-stack.sh查看q-dhcp信息看到:ERROR neutron.agent.linux.dhcp [req-31d73fe5-d79c-4e18-a25a-7975e7f2c16f None None] FAILED VERSION REQUIREMENT FOR DNSMASQ. DHCP AGENT MAY NOT RUN CORRECTLY! Please ensure that its version is 2.63 or above!

解决办法:下载并安装新版本的dnsmasq

wget http://pkgs.repoforge.org/dnsmasq/dnsmasq-2.65-1.el6.rfx.x86_64.rpm  

rpm -Uvh dnsmasq-2.65-1.el6.rfx.x86_64.rpm

5.h-api无法启动

通过./rejoin-stack.sh查看h-api信息看到0.0.0.0:8004端口被占用,./unstack.sh,./clean.sh后用

netstat -lpnt查看发现0.0.0.0:8004端口仍然有进城在使用。即使kill -9杀掉那个进程,依旧会有新进

程产生占用。然后pip install killproc装了个killproc,执行killproc killproc /opt/stack/heat/bin/he

at-api,把所有关联的进程都杀了。如果嫌麻烦重启一下也可以,也不会被占用了。

6.dashboard打不开

telnet了一下:telnet 10.133.19.101 80,不通。发现目前版本,devstack不会去打开iptables的80端口

,所以在运行脚本前,设置一下iptables,编辑 /etc/sysconfig/iptables,添加一行,打开80端口。或者临

时添加:iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT

7.创建虚机后,虚机获取不到ip地址

查看q-dhcp日志发现以下错误:Object "netns" is unknown, try "ip help".原因是 rhel/centos 6.x 的 内核

虽然已经支持network namespace,但安装的iproute 包版本太低,不支持ip netns命令。

但利用网上的做法:

# yum install http://rdo.fedorapeople.org/rdo-release.rpm

# yum install iproute
安装的是rdo-release juno-1,没有针对epel-6的rpm,自然就无法升级iproute了。需要安装icehouse的rdo-release包:
yum install https://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm

最近发现icehouse的rdo-release包变了,变成以下了:https://repos.fedorapeople.org/repos

/openstack/EOL/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm

再修改/etc/yum.repos.d/rdo-release.repo:

baseurl=https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse/epel-6/

然后执行:

yum update iproute

就可以了。

或者卸载掉iproute再安装:

yum -y remove iproute(卸载的时候像rabbitmq也被牵连卸载了,所以升级iproute后重新搭建openstack)

yum -y install https://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/iproute-2.6.32-130.el6ost.netns.2.x86_64.rpm

地址已变,变成以下:https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse

/epel-6/iproute-2.6.32-130.el6ost.netns.2.x86_64.rpm

yum -y install iproute



8. 物理机重启后,mysql、httpd、rabbitmq等服务未启动

安装完毕devstack后,需要开启如下服务

chkconfig rabbitmq-server on (service rabbitmq-server start)
chkconfig httpd on (service httpd start)
chkconfig mysqld on (service mysqld start)
chkconfig openvswitch on (service openvswitch start)

9.手动启动httpd服务时,报错:

Permission denied: AH00072: make_sock: could not bind to address [::]:5000
6月 23 13:39:35 controller httpd[5137]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:5000
6月 23 13:39:35 controller httpd[5137]: no listening sockets available, shutting down
6月 23 13:39:35 controller httpd[5137]: AH00015: Unable to open logs
6月 23 13:39:35 controller systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
6月 23 13:39:35 controller systemd[1]: Failed to start The Apache HTTP Server.
6月 23 13:39:35 controller systemd[1]: Unit httpd.service entered failed state.
6月 23 13:39:35 controller systemd[1]: httpd.service failed.
解决方法:关闭SELINUX

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

10. 上传镜像被killed以及与glance有关的都出错

HttpConnectionPool is full, discarding connection

I have enabled Swift in my local.conf. In that case it seems Glance by default uses Swift as a backend for images, so Swift starts before Glance. But in my case s-proxy service failed to start because there was Ceilometer installed before and its files were discoverable by Paste's WSGI, but Ceilometer was not started (installed all dependencies) yet:

Thus Glance failed to save the test image to Swift backend (the ConnectionPool error seems due to Glance retrying saving request many times enough to exhaust it).

My solution was to clean everything from /opt/stack and run stack.sh anew.

解决方法:搭建之前,在localrc中注释掉ceilometer,不装Ceilometer

11. ./stack.sh的时候报错:Cannot open: http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm. Skipping.

原因:地址已变

解决方法:在localrc中加入如下一行:

RHEL6_RDO_REPO_RPM=https://repos.fedorapeople.org/repos/openstack

/EOL/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm


  • 下载DevStack 这里的devstack 一定要和 git 出来的openstack 源代码的branch 一样,不然会出错。
  • git clone https://github.com/openstack-dev/devstack.git -b stable/juno
  • 更改devstack/local.conf(localrc)
  • ASSWORD=123456
    DATABASE_PASSWORD=$PASSWORD
    RABBIT_PASSWORD=$PASSWORD
    SERVICE_TOKEN=$PASSWORD
    SERVICE_PASSWORD=$PASSWORD
    ADMIN_PASSWORD=$PASSWORD

    USER_DIR=/home/lk
    if [[ -d $USER_DIR/.pip/ ]]; then
        rm -rf $USER_DIR/.pip/
    fi
    mkdir $USER_DIR/.pip
    touch $USER_DIR/.pip/pip.conf
    echo [global] >> $USER_DIR/.pip/pip.conf
    echo index-url=http://pypi.douban.com/simple/ >> $USER_DIR/.pip/pip.conf
    echo [install] >> $USER_DIR/.pip/pip.conf
    echo trusted-host=pypi.douban.com >> $USER_DIR/.pip/pip.conf
    export PIP_CONFIG_FILE=$USER_DIR/.pip/pip.conf

    ## For Keystone
    KEYSTONE_TOKEN_FORMAT=PKI

    ## For Swift
    #SWIFT_REPLICAS=1
    #SWIFT_HASH=011688b44136573e209e

    # Enable Logging
    LOGFILE=/opt/stack/logs/stack.sh.log
    VERBOSE=True
    LOG_COLOR=True
    SCREEN_LOGDIR=/opt/stack/logs

    # Pre-requisite
    ENABLED_SERVICES=rabbit,mysql,key

    ## If you want ZeroMQ instead of RabbitMQ (don't forget to un-declare 'rabbit' from the pre-requesite)
    #ENABLED_SERVICES+=,-rabbit,-qpid,zeromq

    ## If you want Qpid instead of RabbitMQ (don't forget to un-declare 'rabbit' from the pre-requesite)
    #ENABLED_SERVICES+=,-rabbit,-zeromq,qpid
  • # Horizon (Dashboard UI) - (always use the trunk)
    ENABLED_SERVICES+=,horizon
    #HORIZON_REPO=https://github.com/openstack/horizon
    #HORIZON_BRANCH=master

    # Nova - Compute Service
    ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth

    ## Nova Cells
    # ENABLED_SERVICES+=,n-cell

    # Glance - Image Service
    ENABLED_SERVICES+=,g-api,g-reg

    # Swift - Object Storage
    ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account

    # Neutron - Networking Service
    # If Neutron is not declared the old good nova-network will be used
    ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
    #ENABLED_SERVICES+=neutron

    ## Neutron - Load Balancing
    #ENABLED_SERVICES+=,q-lbaas

    ## Neutron - VPN as a Service
    #ENABLED_SERVICES+=,q-

    ## Neutron - Firewall as a Service
    #ENABLED_SERVICES+=,q-fwaas

    # VLAN configuration - LinuxBridge + VLAN模式
    #Q_PLUGIN=ml2
    #Q_AGENT=linuxbridge
    #ENABLE_TENANT_VLANS=True
    #TENANT_VLAN_RANGE=1077:1077
    #PHYSICAL_NETWORK=default
    #LB_PHYSICAL_INTERFACE=eth0

    # VLAN configuration - Open VSwitch + VLAN模式
    #ENABLE_TENANT_VLANS=True
    #TENANT_VLAN_RANGE=1920:2000
    #PHYSICAL_NETWORK=default
    #OVS_PHYSICAL_INTERFACE=eth0
  • # GRE tunnel configuration
    Q_PLUGIN=ml2
    ENABLE_TENANT_TUNNELS=True

    # VXLAN tunnel configuration
    #Q_PLUGIN=ml2
    #Q_ML2_TENANT_NETWORK_TYPE=vxlan

    # Cinder - Block Device Service
    VOLUME_GROUP="cinder-volumes"
    ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch

    # Heat - Orchestration Service
    ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
    #IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2"

    # Ceilometer - Metering Service (metering + alarming)
    #CEILOMETER_BACKEND=mysql
    ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-anotification,ceilometer-acentral,ceilometer-collector,ceilometer-api
    #ENABLED_SERVICES+=,ceilometer-alarm-notifier,ceilometer-alarm-evaluator

    # Apache fronted for WSGI
    #APACHE_ENABLED_SERVICES+=keystone,swift

    RECLONE=no      # Reclone each time
    OFFLINE=false   # Python enviroments

    #GIT_BASE=https://github.com
    IMAGE_URLS+=,https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
    SWIFT_HASH=123456

  • stackrc文件中包含了各个服务的配置介绍,需要安装哪些服务,参照其中的配置进行修改。
  • 复制代码
    复制代码
    #Header
    [[local|localrc]]
    
    # Credentials
    ADMIN_PASSWORD=openstack
    MYSQL_PASSWORD=$ADMIN_PASSWORD
    #DATABASE_PASSWORD=$ADMIN_PASSWORD
    RABBIT_PASSWORD=$ADMIN_PASSWORD
    SERVICE_PASSWORD=$ADMIN_PASSWORD
    SERVICE_TOKEN=$ADMIN_PASSWORD
    
    # Branches
    NOVA_BRANCH=stable/juno
    KEYSTONE_BRANCH=stable/juno
    NEUTRON_BRANCH=stable/juno
    GLANCE_BRANCH=stable/juno
    CINDER_BRANCH=stable/juno
    SWIFT_BRANCH=stable/juno
    HEAT_BRANCH=stable/juno
    TROVE_BRANCH=stable/juno
    HORIZON_BRANCH=stable/juno
    CEILOMETER_BRANCH=stable/juno
    
    #Network Configuration:
    #FLOATING_RANGE=172.16.91.0/24 #openstack 外网ip
    #FIXED_RANGE=10.11.12.0/24 #openstack 内网ip
    HOST_IP=172.16.3.15   #vmware 虚拟机的ip
    
    # Services
    ENABLED_SERVICES=rabbit,mysql,key
    ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
    
    ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
    ENABLED_SERVICES+=,g-api,g-reg
    ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
    
    #Trove
    ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
    ENABLED_SERVICES+=,horizon
    
    #Ceilometer
    ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
    ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval
    
    #Heat
    ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
    IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F19-x86_64-cfntools.qcow2"
    
    #Neutron
    disable_service n-net
    enable_service q-svc
    enable_service q-agt
    enable_service q-dhcp
    enable_service q-l3
    enable_service q-meta
    enable_service neutron
    
    # Neutron - Load Balancing
    ENABLED_SERVICES+=,q-lbaas
    
    # Neutron - VPN as a Service
    ENABLED_SERVICES+=,q-
    
    # Neutron - Firewall as a Service
    ENABLED_SERVICES+=,q-fwaas
    
    # VLAN configuration
    Q_PLUGIN=ml2
    ENABLE_TENANT_VLANS=True
    
    # GRE tunnel configuration
    Q_PLUGIN=ml2
    ENABLE_TENANT_TUNNELS=True
    
    # VXLAN tunnel configuration
    Q_PLUGIN=ml2
    Q_ML2_TENANT_NETWORK_TYPE=vxlan
    
    # Images
    # Use this image when creating test instances
    IMAGE_URLS+=",http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img"
    
    #Swift Requirements
    SWIFT_REPLICAS=1
    SWIFT_HASH=011688b44136573e209e
    
    # Enable Logging
    LOGFILE=/opt/stack/logs/stack.sh.log
    VERBOSE=True
    LOG_COLOR=True
    SCREEN_LOGDIR=/opt/stack/logs
    复制代码
    复制代码
  • 由于网络问题,手动下载OpenStack组件源码
  • 复制代码
    复制代码    
    sudo git clone https://github.com/openstack/nova.git /opt/stack/nova -b stable/juno
    sudo git clone https://github.com/openstack/glance.git /opt/stack/glance -b stable/juno
    sudo git clone https://github.com/openstack/cinder.git /opt/stack/cinder -b stable/juno
    sudo git clone https://github.com/openstack/horizon.git /opt/stack/horizon -b stable/juno
    sudo git clone https://github.com/openstack/keystone.git /opt/stack/keystone -b stable/juno
    sudo git clone https://github.com/openstack/neutron.git /opt/stack/neutron -b stable/juno
    sudo git clone https://github.com/openstack/swift.git /opt/stack/swift -b stable/juno
    sudo git clone https://github.com/openstack/heat.git /opt/stack/heat -b stable/juno
    sudo git clone https://github.com/openstack/heat-cfntools.git /opt/stack/heat-cfntools -b stable/juno
    
    sudo git clone https://github.com/openstack/heat-templates.git /opt/stack/heat-templates -b stable/juno
    
    sudo git clone https://github.com/openstack/requirements.git /opt/stack/requirements -b stable/juno
    sudo git clone https://github.com/openstack/ceilometer.git /opt/stack/ceilometer -b stable/junosudo git clone https://github.com/openstack/requirements.git /opt/stack/requirements -b stable/juno
    sudo git clone https://github.com/kanaka/noVNC.git /opt/stack/noVNC
    复制代码
    复制代码
  • 创建stack用户/组
  • #cd devstack/tools
    #sudo ./devstack/tools/create-stack-user.sh
  • 修改/opt/stack用户/组
  • #chown -R stack:stack /opt/stack
  • 将 stack 赋予root 权限
1
sudo nano  / etc / sudoers
在root 下添加
stack  ALL = ( ALL : ALL ) NOPASSWD: ALL

  将 devstac 的owner 设置为 stack 

1
sudo chown  - R stack:stack devstack  
  • 执行stack.sh

  必须在devstack 执行,否则会遇到会遇到mktemp -d ----xxxxxx 权限不够的错误。 因为当前路径对stack 用户来说,很可能没有写权限

  • #su stack
    #./stack.sh  

参考:http://www.cnblogs.com/yudar/p/4428245.html

http://www.cnblogs.com/heavyhe/p/4546955.html  


你可能感兴趣的:(OpenStack)