1、ubuntu 14041安装openstackjunoubuntu 14.04.1安装juno目录一、环境准备:(默认密码这里都将设置为xmn2014qwer) 3获取openstack安装包 3更新系统和内核 3重启系统应用更新 3配置同步时间 3安装mysql数据库 3安装消息队列 3二、安装和配置keystone 3A、安装keystone 3创建keystone数据库 3生成一个十位的随机数,作为admin_token 4安装 Identity服务 4编辑/etc/keystone/keystone.conf: 4初始化keystone数据库,创建相关数据库表 4重启keystone服
2、务 4删除默认的keystone数据库 4B、配置用户、tenants和角色 4创建admin tenant 4创建admin用户 4创建admin角色 4创建_member_角色 4链接admin tenant、admin和_member_角色和admin用户 4创建service tenant 4C、创建 service entity 和 API endpoint 5创建一个服务实体 5创建keystone的API endpoint 5D、创建openstack客户端环境变量 5为admin用户启用基于credential的认证机制 5三、安装和配置镜像服务 5A、安装配置glance镜像
3、服务 5创建glance数据库 5创建glance用户,使用service tenant和admin角色 5为glance创建一个服务和API endpoint 5安装glance 6编辑/etc/glance/glance-api.conf和/etc/glance/glance-registry.conf: 6初始化glance数据库,创建相关数据库表 6重启glance-registry和glance-api服务 6删除默认的glance数据库 6B、测试glance服务 6四、安装配置nova控制节点 7创建nova数据库 7创建nova用户、服务和KPI endpoint 7安装nov
4、a控制节点 7修改/etc/nova/nova.conf(控制节点配置) 7初始化nova数据库 8重启相关nova服务: 8删除默认的nova数据库 8nova 控制节点测试 8五、安装配置nova计算节点 8安装计算节点包 8修改/etc/nova/nova.conf(控制节点配置) 8判断是否支持硬件虚拟化技术,不支持则配置libvirt使用QEMU代替默认的KVM 9重启nova-compute服务 9删除默认的nova数据库 9Nova查看nova服务状态、镜像状态以及主机状态 9六、安装配置nova网络服务 9A、安装和配置nova网络控制节点 9配置nova网络控制节点/etc/
5、nova/nova.conf 9重启相关nova服务 9B、安装和配置nova网络计算节点 9安装nova network相关包 9配置nova网络计算节点/etc/nova/nova.conf 9重启相关nova服务 10C创建虚拟网络 10生成网络 10创建浮动IP 10七、安装和配置dashboard 10安装dashboard相关的软件包 10卸载ubuntu主题 10配置dashboard 10重启相关服务 10访问http:/controller/horizon即可完成安装 10一、环境准备:(默认密码这里都将设置为xmn2014qwer)获取openstack安装包# apt-g
6、et installubuntu-cloud-keyring# echo deb http:/ubuntu- trusty-updates/juno main /etc/apt/sources.list.d/cloudarchive-juno.list更新系统和内核# apt-get update & apt-get dist-upgrade重启系统应用更新# reboot配置同步时间#apt-get install ntp -y安装mysql数据库# apt-get install mariadb-server python-mysqldb -y 修改mysql配置文件/etc/mysql/
7、fmysqld.# bind-address = 10.0.0.11default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = SET NAMES utf8character-set-server = utf8 重启mysql服务# servicemysql restart 初始化mysql数据库# mysql_secure_installationChange the root password? Y/n nRemove anonymous users
8、? Y/n yDisallow root login remotely? Y/n nRemove test database and access to it? Y/n yReload privilege tables now? Y/n y安装消息队列 Ubuntu使用RabbitMQ作为消息队列.# apt-get install rabbitmq-server -y# rabbitmqctlchange_password guest xmn2014qwer二、安装和配置keystoneA、安装keystone创建keystone数据库#mysql -u root -pmysql CREAT
9、E DATABASE keystone;mysql GRANT ALL PRIVILEGES ON keystone.* TO keystonelocalhost IDENTIFIED BY xmn2014qwer;mysql GRANT ALL PRIVILEGES ON keystone.* TO keystone% IDENTIFIED BY xmn2014qwer;mysql exit生成一个十位的随机数,作为admin_token# openssl rand -hex 10 /ADMIN_TOKEN安装 Identity服务# apt-get install keystone pyt
10、hon-keystoneclient -y编辑/etc/keystone/keystone.conf:DEFAULTadmin_token = e6504e86cbba88ad3c59verbose = Truedatabaseconnection = mysql:/keystone:xmn2014qwercontroller/keystonetokenprovider = keystone.token.providers.uuid.Providerdriver = keystone.token.persistence.backends.sql.Token初始化keystone数据库,创建相关
11、数据库表# su -s /bin/sh -c keystone-manage db_sync keystone重启keystone服务# service keystone restart删除默认的keystone数据库# rm -f /var/lib/keystone/keystone.dbB、配置用户、tenants和角色# cat /ADMIN_TOKEN#export OS_SERVICE_TOKEN=e6504e86cbba88ad3c59# export OS_SERVICE_ENDPOINT=http:/controller:35357/v2.0创建admin tenant# ke
12、ystone tenant-create -name=admin -description=Admin Tenant创建admin用户# keystone user-create -name=admin -pass=admin -email=admin创建admin角色# keystone role-create -name=admin创建_member_角色# keystone role-create -name _member_链接admin tenant、admin和_member_角色和admin用户#keystone user-role-add -user=admin -tenant
13、=admin -role=admin#keystone user-role-add -user=admin -role=_member_ -tenant=admin创建service tenant# keystone tenant-create -name=service -description=Service TenantC、创建 service entity 和 API endpoint创建一个服务实体# keystone service-create -name=keystone -type=identity -description=OpenStack Identity创建keyst
14、one的API endpoint# keystone endpoint-create -service-id=$(keystone service-list | awk / identity / print $2) -publicurl=http:/controller:5000/v2.0 -internalurl=http:/controller:5000/v2.0 -adminurl=http:/controller:35357/v2.0D、创建openstack客户端环境变量为admin用户启用基于credential的认证机制# unset OS_SERVICE_TOKEN OS_SE
15、RVICE_ENDPOINT#vi /.keystonerc_adminexportOS_USERNAME=adminexportOS_PASSWORD=adminexportOS_TENANT_NAME=adminexportOS_AUTH_URL=http:/controller:35357/v2.0export PS1=uh W(keystone_admin)$ # source /.keystonerc_adminrootqhy(keystone_admin)# keystone user-list三、安装和配置镜像服务A、安装配置glance镜像服务创建glance数据库# mysq
16、l -u root -pmysql CREATE DATABASE glance;mysql GRANT ALL PRIVILEGES ON glance.* TO glancelocalhost IDENTIFIED BY xmn2014qwer;mysql GRANT ALL PRIVILEGES ON glance.* TO glance% IDENTIFIED BY xmn2014qwer;创建glance用户,使用service tenant和admin角色#keystone user-create -name=glance -pass=glance -email=glance# k
17、eystone user-role-add -user=glance -tenant=service -role=admin为glance创建一个服务和API endpoint# keystone service-create -name=glance -type=image -description=OpenStack Image Service# keystone endpoint-create -service-id=$(keystone service-list | awk / image / print $2) -publicurl=http:/controller:9292 -in
18、ternalurl=http:/controller:9292 -adminurl=http:/controller:9292安装glance# apt-get install glance python-glanceclienty编辑/etc/glance/glance-api.conf和/etc/glance/glance-registry.conf:DEFAULTverbose = Truedatabaseconnection = mysql:/glance:xmn2014qwercontroller/glancekeystone_authtokenauth_uri = http:/co
19、ntroller:5000/v2.0identity_uri = http:/controller:35357admin_tenant_name = serviceadmin_user = glanceadmin_password = glance paste_deployflavor = keystoneglance_storedefault_store = filefilesystem_store_datadir = /var/lib/glance/images/初始化glance数据库,创建相关数据库表# su -s /bin/sh -c glance-manage db_sync gl
20、ance重启glance-registry和glance-api服务# service glance-registry restart# service glance-api restart删除默认的glance数据库#rm -f /var/lib/glance/glance.sqliteB、测试glance服务# mkdir /tmp/images#cd /tmp/images/#wget#wget http:/cdn.download.cirros-备注:可以使用qemu-img命令分别查看映像文件的格式信息。# qemu-img info cirros-0.3.0-x86_64-disk
21、.imgimage: cirros-0.3.0-x86_64-disk.imgfile format: qcow2virtual size: 39M (41126400 bytes)disk size: 8.7Mcluster_size: 65536# glance image-create -name=cirros -disk-format=qcow2 -container-format=bare CREATE DATABASE nova;mysql GRANT ALL PRIVILEGES ON nova.* TO novalocalhost IDENTIFIED BY xmn2014qw
22、er;mysql GRANT ALL PRIVILEGES ON nova.* TO nova% IDENTIFIED BY xmn2014qwer;创建nova用户、服务和KPI endpoint# keystone user-create -name=nova -pass=nova -email=nova#keystone user-role-add -user=nova -tenant=service -role=admin#keystone service-create -name=nova -type=compute -description=OpenStack Compute#ke
23、ystone endpoint-create -service-id=$(keystone service-list | awk / compute / print $2) -publicurl=http:/controller:8774/v2/%(tenant_id)s -internalurl=http:/controller:8774/v2/%(tenant_id)s -adminurl=http:/controller:8774/v2/%(tenant_id)s安装nova控制节点# apt-get installnova-api nova-cert nova-conductor no
24、va-consoleauth nova-novncproxy nova-scheduler python-novaclient-y修改/etc/nova/nova.conf(控制节点配置)# vi /etc/nova/nova.confDEFAULTrpc_backend = rabbitrabbit_host = controllerrabbit_password = xmn2014qwerauth_strategy = keystonemy_ip = 192.168.40.25vncserver_listen = 0.0.0.0vncserver_proxyclient_address =
25、 192.168.40.25verbose = Truedatabaseconnection = mysql:/nova:xmn2014qwercontroller/novakeystone_authtokenauth_uri = http:/controller:5000/v2.0identity_uri = http:/controller:35357admin_tenant_name = serviceadmin_user = novaadmin_password = novaglancehost = controller初始化nova数据库# su -s /bin/sh -c nova
26、-manage db sync nova重启相关nova服务:# vi restart_nova.shservice nova-api restartservice nova-cert restartservice nova-consoleauth restartservice nova-scheduler restartservice nova-conductor restartservice nova-novncproxy restart# bash restart_nova.sh删除默认的nova数据库# rm -f /var/lib/nova/nova.sqlitenova 控制节点测
27、试# nova image-list五、安装配置nova计算节点安装计算节点包# apt-get install nova-compute sysfsutils-y修改/etc/nova/nova.conf(控制节点配置)# vi /etc/nova/nova.confDEFAULTrpc_backend = rabbitrabbit_host = controllerrabbit_password = xmn2014qwerauth_strategy = keystonemy_ip = 192.168.40.25vnc_enabled = Truevncserver_listen = 0.0
28、.0.0vncserver_proxyclient_address = 192.168.40.25novncproxy_base_url = http:/controller:6080/vnc_auto.htmlverbose = Truedatabaseconnection = mysql:/nova:xmn2014qwercontroller/novakeystone_authtokenauth_uri = http:/controller:5000/v2.0identity_uri = http:/controller:35357admin_tenant_name = serviceadmin_user = novaadmin_password = novaglancehost = controller判断是否支持硬件虚拟化技术,不支持则配置libvirt使用QEMU代替默认的KVM#egrep -c (vmx|svm) /proc/cpuinfo输出值不等于0则代表支持硬件虚拟化技术,否则修改/etc/nova/nova-compute.conf配置文件libvirtvirt_typ
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1