准备环境
selinux、iptables关闭 mkdir -p ~/.pip # 使用豆瓣pip源 vim ~/.pip/pip.conf [global] index-url = http://pypi.douban.com/simple/ yum install -y git # 安装git cd /home git clone https://github.com/openstack-dev/devstack.git cd /home/devstack/tools/ # devstack默认不能以root身份运行 ./create-stack-user.sh # 会创建一个stack用户 chown -R stack. /home/devstack
准备local.conf
su stack # 切换为stack用户 cd /home/devstack/ # 切换到devstack目录下 cp samples/local.conf ./ # 拷贝一个local.conf到本地来 vim local.conf # 编辑local.conf配置文件,填上你需要安装的组件 [[local|localrc]] # Define the devstack install directory DEST=/opt/ice/code/openstack/ #Data directory DATA_DIR=/opt/ice/data #Service dirctory SERVICE_DIR=/opt/ice/data/service #yum command YUM=yum # no internet #OFFLINE=True #Reclone RECLONE=True #all package for lib LIBS_FROM_GIT=True # Minimal Contents # ---------------- # While ``stack.sh`` is happy to run without ``localrc``, devlife is better when # there are a few minimal variables set: # If the ``SERVICE_TOKEN`` and ``*_PASSWORD`` variables are not set # here you will be prompted to enter values for them by ``stack.sh`` # and they will be added to ``local.conf``. SERVICE_TOKEN=ice_token ADMIN_PASSWORD=admin MYSQL_PASSWORD=stackdb RABBIT_PASSWORD=stackmq SERVICE_PASSWORD=$ADMIN_PASSWORD # ``HOST_IP`` should be set manually for best results if the NIC configuration # of the host is unusual, i.e. ``eth1`` has the default route but ``eth0`` is the # public interface. It is auto-detected in ``stack.sh`` but often is indeterminate # on later runs due to the IP moving from an Ethernet interface to a bridge on # the host. Setting it here also makes it available for ``openrc`` to include # when setting ``OS_AUTH_URL``. # ``HOST_IP`` is not set by default. #HOST_IP=w.x.y.z # Logging # ------- # By default ``stack.sh`` output only goes to the terminal where it runs. It can # be configured to additionally log to a file by setting ``LOGFILE`` to the full # path of the destination log file. A timestamp will be appended to the given name. LOGFILE=$DATA_DIR/logs/stack.sh.log # Old log files are automatically removed after 7 days to keep things neat. Change # the number of days by setting ``LOGDAYS``. LOGDAYS=2 # Nova logs will be colorized if ``SYSLOG`` is not set; turn this off by setting # ``LOG_COLOR`` false. #LOG_COLOR=False # Using milestone-proposed branches # --------------------------------- # Uncomment these to grab the milestone-proposed branches from the repos: CINDER_BRANCH=stable/juno GLANCE_BRANCH=stable/juno KEYSTONE_BRANCH=stable/juno NOVA_BRANCH=stable/juno NEUTRON_BRANCH=stable/juno CEILOMETER_BRANCH=stable/juno HORIZON_BRANCH=stable/juno REQUIREMENTS_BRANCH=stable/juno # -------Service # # ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-xvnc,n-cauth,mysql,rabbit ENABLED_SERVICES+=,c-sch,c-api,c-vol ENABLED_SERVICES+=,ceilometer # Horizon config #disable_service horzion # Install the tempest test suite enable_service tempest # 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 q-metering enable_service neutron # VXLAN tunnel configuration Q_PLUGIN=ml2 Q_ML2_TENANT_NETWORK_TYPE=vxlan
安装
cd /home/devstack ./stack.sh # 开始安装 yum install openstack-dashboard httpd # 上面的local.conf没有horizon,我老大测试过了,我手动安装horizon vim /etc/openstack-dashboard/local_settings # 修改内容如下 ALLOW_HOSTS = [‘*‘,‘localhost‘] OPENSTACK_HOST = "172.16.105.16" service httpd restart # 重启服务生效
运行Devstack
admin用户 source /home/devstack/openrc admin admin # 加载环境变量进行操作 demo用户 source /home/devstack/openrc demo demo # 加载环境变量进行操作
参考链接
http://www.chenshake.com/devstack-installation-and-testing/
时间: 2024-10-11 21:11:27