Openstack实验手册_第1页
Openstack实验手册_第2页
Openstack实验手册_第3页
Openstack实验手册_第4页
Openstack实验手册_第5页
已阅读5页,还剩18页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、【精品文档】如有侵权,请联系网站删除,仅供学习与交流Openstack实验手册.精品文档.计算机新技术综合实践研究生实验手册课程名称: 计算机新技术综合实践 实验名称: 安装部署OpenStack 实验地点: 专 业: 班 级: 指导教师: 吴含前 实验时间: 年 月 日实验一 64位Linux下手动安装OpenStack Icehouse版本【实验内容】学习VMware workstation虚拟机的使用,在 CentOS 64位环境下安装搭建OpenStack环境,熟悉Linux基本操作,锻炼同学学习能力、动手能力和分析问题能力。【实验目的】1、熟悉VMware workstation虚拟

2、机使用2、了解OpenStack整体架构3、了解OpenStack各组件功能4、能够在Linux下手动搭建OpenStack云计算环境【实验环境】计算机实验室VMware workstation虚拟机【实验步骤】一、VMware workstation下安装CentOS 6.5 x64操作系统1、 首先安装VMware Workstation2、 创建OpenStack控制节点,文件 新建虚拟机3、 选择 典型(推荐) 下一步4、 稍后安装操作系统5、 选择操作系统和版本6、 输入虚拟机名称和安装路径7、 设置磁盘大小8、 自定义硬件9、 选择CentOS安装镜像文件10、 点击完成11、 启

3、动虚拟机12、 选择第一项,安装全新操作系统或升级现有操作系统13、 Tab键进行选择,选择Skip,退出检测14、 点击Next15、 选择语言,这里选择的是中文简体16、 选择键盘样式17、 选择存储设备18、 输入主机名19、 配置网络20、 设置时区,勾选使用UTC时间21、 输入根用户(root)的密码22、 根据此Linux具体功能,选择不同的方式23、 选择现在自定义,自定义安装需要的软件,如桌面配置24、 点击下一步,开始安装25、 安装完成后,点击重新导引26、 点击前进按钮27、 点击是,同意许可,再点击前进按钮28、 创建用户29、 设置日期和时间,如果可以上网,勾选在网

4、上同步日期和时间二、OpenStack环境预配置1、 设置OpenStack网络,一块NAT网卡,一块仅主机网卡2、 同理创建另外两台虚拟机,一台计算节点,一台网络节点3、 配置虚拟机网络环境,如下表服务器网卡配置主机名管理节点(ControllerNode)eth0:30eth1:30controller计算节点(ComputeNode)eth0:31eth1:31compute1网络节点(NetworkNode)eth0:32eth1:32eth2:(onboot=”ye

5、s”, bootproto=”none”)network三、OpenStack环境搭建1、 安装部署控制节点(1) 首先配置Linux能上网,可以ping通(2) 安装MySQL数据库如下执行命令# yum install ntp# service ntpd start# chkconfig ntpd on# yum install mysql mysql-server MySQL-python编辑 /etc/f 文件:# vi /etc/fmysqldbind-address = 30 #添加这句mysqlddefault-storage-engine = innodb #

6、添加这句innodb_file_per_table #添加这句collation-server = utf8_general_ci#添加这句init-connect = 'SET NAMES utf8'#添加这句character-set-server = utf8#添加这句保存退出# service mysqld start# chkconfig mysqld on# mysql_install_db# mysql_secure_installation(3) 安装OpenStack软件源包# yum install yum-plugin-priorities# yum in

7、stall /repos/openstack/openstack-icehouse/rdo-release-icehouse-3.noarch.rpm# yum install /pub/epel/6/x86_64/epel-release-6-8.noarch.rpm# yum install openstack-utils# yum install openstack-selinux# yum upgrade# reboot(4) 安装qpid# yum install qpid-c

8、pp-server编辑/etc/qpidd.conf文件# vi /etc/qpidd.confauth=no#修改为no保存退出# service qpidd start# chkconfig qpidd on(5) 安装keystone组件# yum install openstack-keystone python-keystoneclient# openstack-config -set /etc/keystone/keystone.conf database connection mysql:/keystone:keystonecontroller/keystone$ mysql -

9、u root -pmysql> CREATE DATABASE keystone;mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone''localhost' IDENTIFIED BY 'keystone'mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone''%' IDENTIFIED BY 'keystone'mysql> exit# su -s /bin/s

10、h -c "keystone-manage db_sync" keystone# ADMIN_TOKEN=$(openssl rand -hex 10)# echo $ADMIN_TOKEN# openstack-config -set /etc/keystone/keystone.conf DEFAULT admin_token $ADMIN_TOKEN# keystone-manage pki_setup -keystone-user keystone -keystone-group keystone# chown -R keystone:keystone /etc/k

11、eystone/ssl# chmod -R o-rwx /etc/keystone/ssl# service openstack-keystone start# chkconfig openstack-keystone on# (crontab -l -u keystone 2>&1 | grep -q token_flush) | echo 'hourly /usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1' >>

12、 /var/spool/cron/keystone编辑/.bash_profile文件,在最后添加export OS_USERNAME=adminexport OS_PASSWORD=adminexport OS_TENANT_NAME=adminexport OS_AUTH_URL=http:/controller:35357/v2.0export ADMIN_TOKEN=223e5aa00e1401925a5d【注意此值与ADMIN_TOKEN值一样】export SERVICE_TOKEN=$ADMIN_TOKENexport SERVICE_ENDPOINT=http:/control

13、ler:35357/v2.0export OS_SERVICE_TOKEN=$ADMIN_TOKENexport OS_SERVICE_ENDPOINT=http:/controller:35357/v2.0保存退出#source /.bash_profile$ keystone user-create -name=admin -pass=admin -email=admin$ keystone role-create -name=admin$ keystone tenant-create -name=admin -description="Admin Tenant"$ k

14、eystone user-role-add -user=admin -tenant=admin -role=admin$ keystone user-role-add -user=admin -role=_member_ -tenant=admin$ keystone user-create -name=demo -pass=demo -email=demo$ keystone tenant-create -name=demo -description="Demo Tenant"$ keystone user-role-add -user=demo -role=_membe

15、r_ -tenant=demo$ keystone tenant-create -name=service -description="Service Tenant"$ keystone service-create -name=keystone -type=identity -description="OpenStack Identity"$ keystone endpoint-create -service-id=$(keystone service-list | awk '/ identity / print $2') -publi

16、curl=http:/controller:5000/v2.0 -internalurl=http:/controller:500key0/v2.0 -adminurl=http:/controller:35357/v2.0(6) 安装glance组件# yum install openstack-glance python-glanceclient# openstack-config -set /etc/glance/glance-api.conf database connection mysql:/glance:glancecontroller/glance# openstack-con

17、fig -set /etc/glance/glance-registry.conf database connection mysql:/glance:glancecontroller/glance$ mysql -u root -pmysql> CREATE DATABASE glance;mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance''localhost' IDENTIFIED BY 'glance'mysql> GRANT ALL PRIVILEGES ON glan

18、ce.* TO 'glance''%' IDENTIFIED BY 'glance'mysql> exit;# openstack-db -init -service glance # keystone user-create -name=glance -pass=glance -email=glance# keystone user-role-add -user=glance -tenant=service -role=admin# openstack-config -set /etc/glance/glance-api.conf key

19、stone_authtoken auth_uri http:/controller:5000# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken auth_host controller# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken auth_p

20、rotocol http# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken admin_user glance# openstack-config -set /etc/glance/glance-api.conf keystone_authtoken admin_password glance# openstack-

21、config -set /etc/glance/glance-api.conf paste_deploy flavor keystone# openstack-config -set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http:/controller:5000# openstack-config -set /etc/glance/glance-registry.conf keystone_authtoken auth_host controller# openstack-config -set /etc/g

22、lance/glance-registry.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/glance/glance-registry.conf keystone_authtoken auth_protocol http# openstack-config -set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service# openstack-config -set /etc/glance/glance-r

23、egistry.conf keystone_authtoken admin_user glance# openstack-config -set /etc/glance/glance-registry.conf keystone_authtoken admin_password glance# openstack-config -set /etc/glance/glance-registry.conf paste_deploy flavor keystone# keystone service-create -name=glance -type=image -description="

24、;OpenStack Image Service"# keystone endpoint-create -service-id=$(keystone service-list | awk '/ image / print $2') -publicurl=http:/controller:9292 -internalurl=http:/controller:9292 -adminurl=http:/controller:9292# service openstack-glance-api restart# service openstack-glance-registr

25、y restart# chkconfig openstack-glance-api on# chkconfig openstack-glance-registry on(7) 安装Nova组件# yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient# openstack-config -set /etc/nova/n

26、ova.conf database connection mysql:/nova:novacontroller/nova# openstack-config -set /etc/nova/nova.conf DEFAULT rpc_backend qpid# openstack-config -set /etc/nova/nova.conf DEFAULT qpid_hostname controller# openstack-config -set /etc/nova/nova.conf DEFAULT my_ip 30# openstack-config -set /et

27、c/nova/nova.conf DEFAULT vncserver_listen 30# openstack-config -set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 30(控制节点Controller IP地址)$ mysql -u root -pmysql> CREATE DATABASE nova;mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova''localhost' IDENTI

28、FIED BY 'nova'mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova''%' IDENTIFIED BY 'nova'mysql> exit;# su -s /bin/sh -c "nova-manage db sync" nova# keystone user-create -name=nova -pass=nova -email=nova# keystone user-role-add -user=nova -tenant=service -r

29、ole=admin# openstack-config -set /etc/nova/nova.conf DEFAULT auth_strategy keystone# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_uri http:/controller:5000# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_host controller# openstack-config -set /etc/nova/nova.co

30、nf keystone_authtoken auth_protocol http# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/nova/nova.conf keystone_authtoken admin_user nova# openstack-config -set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service# openstack-conf

31、ig -set /etc/nova/nova.conf keystone_authtoken admin_password nova# keystone service-create -name=nova -type=compute -description="OpenStack Compute"# keystone endpoint-create -service-id=$(keystone service-list | awk '/ compute / print $2') -publicurl=http:/controller:8774/v2/%(te

32、nant_id)s -internalurl=http:/controller:8774/v2/%(tenant_id)s -adminurl=http:/controller:8774/v2/%(tenant_id)s# service openstack-nova-api restart# service openstack-nova-cert restart# service openstack-nova-consoleauth restart# service openstack-nova-scheduler restart# service openstack-nova-conduc

33、tor restart# service openstack-nova-novncproxy restart# chkconfig openstack-nova-api on# chkconfig openstack-nova-cert on# chkconfig openstack-nova-consoleauth on# chkconfig openstack-nova-scheduler on# chkconfig openstack-nova-conductor on# chkconfig openstack-nova-novncproxy on(8) 安装Neutron组件# yum

34、 install openstack-neutron openstack-neutron-ml2 python-neutronclient$ mysql -u root -pmysql> CREATE DATABASE neutron;mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron''localhost' IDENTIFIED BY 'neutron'mysql> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'

35、'%' IDENTIFIED BY 'neutron'mysql> exit;$ keystone user-create -name neutron -pass neutron -email neutron$ keystone user-role-add -user neutron -tenant service -role admin$ keystone service-create -name=neutron -type=network -description="OpenStack Networking"$ keystone e

36、ndpoint-create -service-id $(keystone service-list | awk '/ network / print $2') -publicurl http:/controller:9696 -adminurl http:/controller:9696 -internalurl http:/controller:9696# openstack-config -set /etc/neutron/neutron.conf database connection mysql:/neutron:neutroncontroller/neutron#

37、openstack-config -set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_uri http:/controller:5000# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_host controller# openstack-config -set /etc/neutr

38、on/neutron.conf keystone_authtoken auth_protocol http# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken admin_tenant_name service# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken

39、admin_user neutron# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken admin_password neutron# openstack-config -set /etc/neutron/neutron.conf DEFAULT rpc_backend mon.rpc.impl_qpid# openstack-config -set /etc/neutron/neutron.conf DEFAULT qpid_hostname controller# openstack-config -se

40、t /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes True# openstack-config -set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True# openstack-config -set /etc/neutron/neutron.conf DEFAULT nova_url http:/controller:8774/v2# openstack-config -set /etc/neutron/ne

41、utron.conf DEFAULT nova_admin_username nova# openstack-config -set /etc/neutron/neutron.conf DEFAULT nova_admin_tenant_id $(keystone tenant-list | awk '/ service / print $2 ')# openstack-config -set /etc/neutron/neutron.conf DEFAULT nova_admin_password nova# openstack-config -set /etc/neutro

42、n/neutron.conf DEFAULT nova_admin_auth_url http:/controller:35357/v2.0# openstack-config -set /etc/neutron/neutron.conf DEFAULT core_plugin ml2# openstack-config -set /etc/neutron/neutron.conf DEFAULT service_plugins router# openstack-config -set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_driver

43、s gre# openstack-config -set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types gre# openstack-config -set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers openvswitch# openstack-config -set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_gre tunnel_id_ranges 1:1000# openstack-

44、config -set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver# openstack-config -set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_security_group True# openstack-config -set /etc/nova/nova.conf DEFAU

45、LT network_api_class work.neutronv2.api.API# openstack-config -set /etc/nova/nova.conf DEFAULT neutron_url http:/controller:9696# openstack-config -set /etc/nova/nova.conf DEFAULT neutron_auth_strategy keystone# openstack-config -set /etc/nova/nova.conf DEFAULT neutron_admin_tenant_name service# ope

46、nstack-config -set /etc/nova/nova.conf DEFAULT neutron_admin_username neutron# openstack-config -set /etc/nova/nova.conf DEFAULT neutron_admin_password neutron# openstack-config -set /etc/nova/nova.conf DEFAULT neutron_admin_auth_url http:/controller:35357/v2.0# openstack-config -set /etc/nova/nova.

47、conf DEFAULT linuxnet_interface_driver work.linux_net.LinuxOVSInterfaceDriver# openstack-config -set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver# openstack-config -set /etc/nova/nova.conf DEFAULT security_group_api neutron security_group_api neutron# ln -s plugi

48、ns/ml2/ml2_conf.ini /etc/neutron/plugin.ini# service openstack-nova-api restart# service openstack-nova-scheduler restart# service openstack-nova-conductor restart# service neutron-server restart# chkconfig neutron-server on2、 安装部署计算节点(1) 首先配置Linux能上网,可以ping通(2) 安装OpenStack软件包源# yum install yum-plug

49、in-priorities# yum install /repos/openstack/openstack-icehouse/rdo-release-icehouse-3.noarch.rpm# yum install /pub/epel/6/x86_64/epel-release-6-8.noarch.rpm# yum install openstack-utils# yum install openstack-selinux# yum upgrade# reboot(3) 安装Nov

50、a组件# yum install openstack-nova-compute# openstack-config -set /etc/nova/nova.conf database connection mysql:/nova:novacontroller/nova# openstack-config -set /etc/nova/nova.conf DEFAULT auth_strategy keystone# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_uri http:/controller:500

51、0# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_host controller# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_protocol http# openstack-config -set /etc/nova/nova.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/nova/nova.conf keystone_auth

52、token admin_user nova# openstack-config -set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service# openstack-config -set /etc/nova/nova.conf keystone_authtoken admin_password nova# openstack-config -set /etc/nova/nova.conf DEFAULT rpc_backend qpid# openstack-config -set /etc/nova/nova.co

53、nf DEFAULT qpid_hostname controller# openstack-config -set /etc/nova/nova.conf DEFAULT my_ip 31# openstack-config -set /etc/nova/nova.conf DEFAULT vnc_enabled True# openstack-config -set /etc/nova/nova.conf DEFAULT vncserver_listen # openstack-config -set /etc/nova/nova.conf DEFAULT

54、vncserver_proxyclient_address 31# openstack-config -set /etc/nova/nova.conf DEFAULT novncproxy_base_url http:/controller:6080/vnc_auto.html# openstack-config -set /etc/nova/nova.conf DEFAULT glance_host controller# egrep -c '(vmx|svm)' /proc/cpuinfo(如果返回0,执行下面这句,否则不执行)# openstack-co

55、nfig -set /etc/nova/nova.conf libvirt virt_type qemu# service libvirtd start# service messagebus start# service openstack-nova-compute start# chkconfig libvirtd on# chkconfig messagebus on# chkconfig openstack-nova-compute on(4) 安装Neutron组件编辑 /etc/sysctl.conf文件# vi /etc/sysctl.confnet.ipv4.conf.all.

56、rp_filter=0net.ipv4.conf.default.rp_filter=0保存退出# modprobe bridge# sysctl -p# yum install openstack-neutron-ml2 openstack-neutron-openvswitch# openstack-config -set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_uri h

57、ttp:/controller:5000# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_host controller# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_protocol http# openstack-config -set /etc/neutron/neutron.conf keystone_authtoken auth_port 35357# openstack-config -set /etc/neutron/n

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论