首页 > 代码库 > OpenStack Grizzly版本(Ubuntu 12.04)配置
OpenStack Grizzly版本(Ubuntu 12.04)配置
1. 我们在一天VMware虚拟机上(双网卡)使用Ubuntu 12.04.1 和 OpenVSwitch 1.4.6 来搭建OpenStack的Grizzly版本的平台。 由于OpenVSwitch的版本对Ubuntu系统的内核版本有依赖,建议在安装前请确认二者之间是否兼容。无论是在物理机器中还是VMware 中配置,都需要开启CPU 的虚拟化(Intel VT-x/EPT 或AMD-V/RVI(V)。OpenStack-Grizzly-Install-Gui...
11.0 KB
2. 为了提高Ubuntu 12.04.1的更新速度,将163的源加入/etc/apt/sources.list中。sources.list
5.0 KB
5.0 KB
3. 添加OpenStack Grizzly版本的库:
安装:apt-get install ubuntu-cloud-keyring python-software-properties software-properties-common python-keyring
cat > /etc/apt/sources.list.d/grizzly.list << _EOF_deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly maindeb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/grizzly main_EOF_
更新软件源和软件:apt-get update; apt-get upgrade
4. 安装ssh-server:
apt-get install openssh-server
5. 禁用network-manager:
/etc/init.d/NetworkManager stop
6. 安装mysql
apt-get install -y mysql-server python-mysqldb修改mysql的配置文件/etc/mysql/my.cnf:sed -i ‘s/127.0.0.1/0.0.0.0/g‘ /etc/mysql/my.cnf# sed -i ‘44 i skip-name-resolve‘ /etc/mysql/my.cnf 禁止mysql做域名解析,防止连接mysql出现错误和远程连接mysql慢的现象在my.cnf中添加:[client]default-character-set=utf8[mysqld]#default-storage-engine=INNODBcharacter-set-server=utf8collation-server=utf8_general_ci
7. 安装rabbitMQ
apt-get install -y rabbitmq-server
8. 安装NTP服务:
apt-get install -y ntp
9. 安装keystone
apt-get install -y keystone在mysql中创建keystone数据库,并授权用户keystone访问:# mysql -uroot -pmysql> create database keystone;mysql> grant all on keystone.* to ‘keystone‘@‘%‘ identified by ‘keystone‘;mysql> flush privileges; quit;修改/etc/keystone/keystone.conf中的数据库连接:connection = mysql://keystone:keystone@172.15.0.111/keystone重启keystone和同步数据库:service keystone restartkeystone-manage db_sync
修改如下两个文件的权限: keystone_endpoints_basic.sh
4.4 KB
chmod +x keystone_basic.shchmod +x keystone_endpoints_basic.sh运行这两个脚本:./keystone_basic.sh./keystone_endpoints_basic.sh
创建一个凭证文件:# cat > /root/creds.sh << _EOF_export OS_TENANT_NAME=adminexport OS_USERNAME=adminexport OS_PASSWORD=passwordexport OS_AUTH_URL="http://172.15.0.111:5000/v2.0/"_EOF_# echo ‘source /root/creds.sh‘ >> /root/.bashrc# source /root/creds.sh
10. 安装glance:
apt-get install -y glance创建glance数据库:#mysql -uroot -pmysql> create database glance;mysql> grant all on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;mysql> flush privileges; quit;
修改 /etc/glance/glance-api-paste.ini:[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factorydelay_auth_decision = trueauth_host = 172.15.0.111auth_port = 35357auth_protocol = httpamdin_tenant_name = serviceadmin_user = glanceadmin_password = password
修改 /etc/glance/glance-registry-paste.ini:[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryauth_host = 172.15.0.111auth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = glanceadmin_password = password
修改/etc/glance/glance-api.conf:sql_connection = mysql://glance:glance@172.15.0.111/glance[paste_deploy]flavor = keystone修改/etc/glance/glance-registry.conf:sql_connection = mysql://glance:glance@172.15.0.111/glance[paste_deploy]flavor = keystone
重启glance-api和glance-registry服务并同步数据库:service glance-api restart; service glance-registry restartglance-manage db_syncservice glance-api restart; service glance-registry restart
上传镜像,下载Cirros img作为测试使用:# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img# glance image-create --name=‘cirros‘ --public --container-format=ovf --disk-format=qcow2 < ./cirros-0.3.0-x86_64-disk.img查看刚才上传的镜像:glance image-list
11.安装quantum
安装openVSwitch:apt-get install -y openvswitch-switch openvswitch-datapath-dkms创建网桥:ovs-vsctl add-br br-intovs-vsctl add-br br-exovs-vsctl add-port br-ex eth0 (将eth0加入br-ex)手动配置网卡配置文件:#vi /etc/network/interfacesauto loiface lo inet loopbackauto eth0iface eth0 inet manualup ifconfig $IFACE 0.0.0.0 updown ifconfig $IFACE downauto br-exiface br-ex inet staticaddress 192.168.8.20netmask 255.255.255.0gateway 192.168.8.1dns-nameservers 208.67.222.222auto eth1iface eth1 inet staticaddress 172.15.0.111netmask 255.255.255.0
安装quantum和相关组件:apt-get install -y quantum-server quantum-plugin-openvswitch quantum-plugin-openvswitch-agent dnsmasq quantum-dhcp-agent quantum-l3-agent创建数据:mysql -uroot -pmysql> create database quantum;mysql> grant all on quantum.* to ‘quantum‘@‘%‘ identified by ‘quantum‘;mysql> flush privileges; quit;查看quantum的相关组件是否运行:cd /etc/init.d/; for i in $( ls quantum-* ); do sudo service $i status; done
修改/etc/quantum/api-paste.ini:[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 172.15.0.111auth_port = 35357auth_protocol = http
admin_tenant_name = serviceadmin_user = quantumadmin_password = password
修改OVS plugin的配置文件/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:#Under the database section
[DATABASE]
sql_connection = mysql://quantum:quantum@172.15.0.111/quantum #Under the OVS section
[OVS]tenant_network_type = gretunnel_id_ranges = 1:1000
integration_bridge = br-inttunnel_bridge = br-tunlocal_ip = 172.15.0.111enable_tunneling = True
#Firewall driver for realizing quantum security group function[SECURITYGROUP]
firewall_driver = quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
更新/etc/quantum/metadata_agent.ini:# The Quantum user information for accessing the Quantum API.auth_url = http://172.15.0.111:35357/v2.0auth_region = RegionOneadmin_tenant_name = serviceadmin_user = quantumadmin_password = password# IP address used by Nova metadata servernova_metadata_ip = 127.0.0.1# TCP Port used by Nova metadata servernova_metadata_port = 8775metadata_proxy_shared_secret = helloOpenStack
修改 /etc/quantum/quantum.conf:[keystone_authtoken]auth_host = 172.15.0.111auth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = quantumadmin_password = passwordsigning_dir = /var/lib/quantum/keystone-signing
重启quantum的所有服务:cd /etc/init.d/; for i in $( ls quantum-* ); do sudo service $i restart; doneservice dnsmasq restart
12. 安装nova:
apt-get install nova-api nova-novncproxy novnc nova-ajax-console-proxy nova-cert nova-consoleauth nova-doc nova-scheduler nova-compute nova-conductor创建数据库:# mysql -uroot -pmysql> create database nova;mysql> grant all on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;mysql> flush privileges; quit;查看nova所有服务的状态:cd /etc/init.d/; for i in $( ls nova-* ); do service $i status; cd; done
修改配置文件/etc/nova/api-paste.ini:[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryauth_host = 172.15.0.111auth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = novaadmin_password = passwordsigning_dirname = /tmp/keystone-signing-nova# Workaround for https://bugs.launchpad.net/nova/+bug/1154809auth_version = v2.0
修改 /etc/nova/nova.conf文件:[DEFAULT]logdir=/var/log/novastate_path=/var/lib/novalock_path=/var/lock/novaverbose=Trueapi_paste_config=/etc/nova/api-paste.inicompute_scheduler_driver=nova.scheduler.filter_scheduler.FilterSchedulerrabbit_host=172.15.0.111nova_url=http://172.15.0.111:8774/v1.1/sql_connection=mysql://nova:nova@172.15.0.111/novaroot_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf# Authuse_deprecated_auth=falseauth_strategy=keystone# Imaging serviceglance_api_servers=172.15.0.111:9292image_service=nova.image.glance.GlanceImageService# Vnc configurationnovnc_enabled=truenovncproxy_base_url=http://192.168.8.20:6080/vnc_auto.htmlnovncproxy_port=6080vncserver_proxyclient_address=172.15.0.111vncserver_listen=0.0.0.0# Network settingsnetwork_api_class=nova.network.quantumv2.api.APIquantum_url=http://172.15.0.111:9696quantum_auth_strategy=keystonequantum_admin_tenant_name=servicequantum_admin_username=quantumquantum_admin_password=passwordquantum_admin_auth_url=http://172.15.0.111:35357/v2.0libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriverlinuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver#If you want Quantum + Nova Security groupsfirewall_driver=nova.virt.firewall.NoopFirewallDriversecurity_group_api=quantum#If you want Nova Security groups only, comment the two lines above and uncomment line -1-.#-1-firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver#Metadataservice_quantum_metadata_proxy = Truequantum_metadata_proxy_shared_secret = helloOpenStackmetadata_host = 172.15.0.111metadata_listen = 127.0.0.1metadata_listen_port = 8775# Compute #compute_driver=libvirt.LibvirtDriver# Cinder #volume_api_class=nova.volume.cinder.APIosapi_volume_listen_port=5900
修改/etc/nova/nova-compute.conf文件:[DEFAULT]libvirt_type= qemu #kvm主要配置在物理机器上,在vmware上应该配置为qemulibvirt_ovs_bridge=br-intlibvirt_vif_type=ethernetlibvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriverlibvirt_use_virtio_for_bridges=True
同步数据库:nova-manage db sync重启nova-*服务:cd /etc/init.d/; for i in $( ls nova-* ); do sudo service $i restart; done检查nova-*服务:nova-manage service list
13. cinder安装
apt-get install cinder-api cinder-common cinder-scheduler cinder-volume python-cinderclient创建数据库:#mysql -uroot -pmysql> create database cinder;mysql> grant all on cinder.* to ‘cinder‘@‘%‘ identified by ‘cinder‘;mysql> flush privileges; quit;
修改配置文件/etc/cinder/api-paste.ini:[filter:authtoken]paste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryservice_protocol = httpservice_host = 172.15.0.111service_port = 5000auth_host = 172.15.0.111auth_port = 35357auth_protocol = httpadmin_tenant_name = serviceadmin_user = cinderadmin_password = passwordsigning_dir = /var/lib/cinder修改配置文件/etc/cinder/cinder.conf:[DEFAULT]rootwrap_config=/etc/cinder/rootwrap.confsql_connection = mysql://cinder:cinder@172.15.0.111/cinderapi_paste_config = /etc/cinder/api-paste.iniiscsi_helper=tgtadmvolume_name_template = volume-%svolume_group = cinder-volumesverbose = Trueauth_strategy = keystonestate_path = /var/lib/cinderlock_path = /var/lock/cindervolume_dir = /var/lib/cinder/volumes#osapi_volume_listen_port=5900同步数据库:cinder-manage db sync
重启cinder的服务:cd /etc/init.d/; for i in $( ls cinder-* ); do sudo service $i restart; done查看cinder的服务:cd /etc/init.d/; for i in $( ls cinder-* ); do sudo service $i status; done
14. 安装horizon:
apt-get -y install openstack-dashboard memcached可以选择性删除OpenStack Ubuntu theme:dpkg --purge openstack-dashboard-ubuntu-theme
修改memcached的监听地址:# vi /etc/openstack-dashboard/local_settings.pyDEBUG = True重启apache2和memcached服务:service apache2 restart; service memcached restart
15.创建网络EXTERNAL_NET_ID=$(quantum net-create external_net1 --router:external=True | awk ‘/ id / {print $4}‘)SUBNET_ID=$(quantum subnet-create external_net1 192.168.8.0/24 --name=external_subnet1 --gateway_ip 192.168.8.1 --enable_dhcp=False | awk ‘/ id / {print $4}‘)修改组策略:# nova secgroup-add-rule default tcp 22 22 0.0.0.0/0# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。