重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

vmware如何安装openstack并安装mysql,keystonglance,nova

小编给大家分享一下vmware如何安装openstack并安装MySQL,keyston glance,nova,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

创新互联公司是网站建设专家,致力于互联网品牌建设与网络营销,专业领域包括网站设计制作、网站建设、电商网站制作开发、小程序开发、微信营销、系统平台开发,与其他网站设计及系统开发公司不同,我们的整合解决方案结合了恒基网络品牌建设经验和互联网整合营销的理念,并将策略和执行紧密结合,且不断评估并优化我们的方案,为客户提供全方位的互联网品牌整合方案!

用vmware 创建三台虚拟机,分别命名:controller, compute, network. 在controller节点上: 1.sudo nano /etc/hostname 2.将 ubuntu 修改为 controller #ubuntu是默认的hostname 3.ifconfig 查看controller 节点上的IP地址,记住IP地址

在compute节点上: 1.sudo nano /etc/hostname 2.将 ubuntu 修改为 compute #ubuntu是默认的hostname 3.ifconfig 查看compute 节点上的IP地址,记住IP地址

在network节点上: 1.sudo nano /etc/hostname 2.将 ubuntu 修改为 network #ubuntu是默认的hostname 3.ifconfig 查看network节点上的IP地址,记住IP地址

三个节点修改hostname后执行reboot

在三个节点上同样操作: 1.sudo nano /etc/hosts 2.添加三个IP地址,刚才记录的: 192.168.40.142 controller 192.168.40.141 compute 192.168.40.143 network

在三个节点是都执行 sudo service networking restart

执行后各自执行ping命令,ping其余两台的hostname,看是否能ping通

配置好三个虚拟机的节点后.

在controller节点上: 1.sudo apt-get update 进行更新 2.sudo apt-get install python-mysqldb mariadb-server mysql-server 安装完mysql后 3.sudo vim /etc/mysql/my.cnf 4.修改 [mysqld] bind-address = xxx.xxx.xxx.xx # controller 节点的IP default-storage-engine = innodb innodb_file_per_table collation-server = utf8_general_ci init-connect = 'SET NAMES utf8' character-set-server = utf8

5.sudo service mysql restart 6.sudo mysql_install_db 7.sudo mysql_secure_installation #*Enter yes for all 8. sudo apt-get install rabbitmq-server 9.sudo rabbitmqctl change_password guest openstack #openstack 是 rabbitmq server 的密码 10.sudo apt-get install keystone 11.sudo nano /etc/keystone/keystone.conf

[sql]

The SQLAlchemy connection string used to connect to the database

connection = mysql://keystone:openstack@controller/keystone ...

这里的openstack 是 keystone 数据库密码 controller 是当前工作节点的 hostname 12.sudo rm -f /var/lib/keystone/keystone.db

$ mysql -u root -p mysql> CREATE DATABASE keystone; mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'openstack'; mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'openstack';

这里的openstack是keystone database 密码

$ sudo keystone-manage db_sync

$ sudo nano /etc/keystone/keystone.conf

[DEFAULT] # A "shared secret" between keystone and other openstack services admin_token = openstack ... #openstack > admin token password

$ sudo service keystone restart

$ export OS_SERVICE_TOKEN=openstack $ export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0

#openstack > admin token

$ keystone tenant-create --name=admin --description="Admin Tenant" $ keystone tenant-create --name=service --description="Service Tenant"

$ keystone user-create --name=admin --pass=openstack --email=admin@controller

#openstack > admin password

$ keystone role-create --name=admin

$ keystone user-role-add --user=admin --tenant=admin --role=admin

$keystone tenant-create --name demo --description "Demo Tenant"

$ keystone user-create --name demo --tenant demo --pass DEMO_PASS --email demo@example.com

$ keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"

$ keystone endpoint-create --service-id=the_service_id_above[a0f5eb172e104a67847bac8f8578fa2a] --publicurl=http://controller:5000/v2.0 --internalurl=http://controller:5000/v2.0 --adminurl=http://controller:35357/v2.0

*enter above displayed service id in place of

$ unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT

$ keystone --os-username=admin --os-password=openstack --os-auth-url=http://controller:35357/v2.0 token-get

*openstack > admin password

$ keystone --os-username=admin --os-password=openstack --os-tenant-name=admin --os-auth-url=http://controller:35357/v2.0 token-get

*openstack > admin password

$ touch openrc.sh

export OS_USERNAME=admin export OS_PASSWORD=openstack export OS_TENANT_NAME=admin export OS_AUTH_URL=http://controller:35357/v2.0

$touch demo-openrc.sh export OS_TENANT_NAME=demo export OS_USERNAME=demo export OS_PASSWORD=DEMO_PASS export OS_AUTH_URL=http://controller:5000/v2.0

$ source openrc.sh

$ keystone token-get

$ keystone user-list

$ mysql -u root -p

CREATE DATABASE glance; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'openstack'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'openstack'; exit

$ source openrc.sh $ keystone user-create --name glance --pass openstack $ keystone user-role-add --user glance --tenant service --role admin $ 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 --internalurl http://controller:9292 --adminurl http://controller:9292 --region regionOne

$ apt-get install glance

$ apt-get install python-glanceclient

$ nano /etc/glance/glance-api.conf

[DEFAULT] ... verbose = True [database] ... 注消sqlite_db =..... connection = mysql://glance:openstack@controller/glance

[keystone_authtoken] ... auth_host = controller auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = openstack

[paste_deploy] ... flavor = keystone ..... notifier_strategy = default notification_driver = noop

$ nano /etc/glance/glance-registry.conf [DEFAULT] verbose = True .... [database] 注消sqlite_db = /var/lib/glance/glance.sqlite connection = mysql://glance:openstack@controller/glance

[keystone_authtoken] auth_host = controller auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = openstack

[paste_deploy] ... flavor = keystone

notification_driver = noop

$glance-manage db_sync


出现错误时: Tables "migrate_version" have non utf8 collation, please make sure all tables are CHARSET=utf8 执行: mysql -u root -p mysql> alter table migrate_version convert to character set utf8 collate utf8_unicode_ci; mysql> flush privileges; mysql> quit


$rm -f /var/lib/glance/glance.sqlite $service glance-registry restart $service glance-api restart $mkdir /tmp/images $cd /tmp/images $wget http://cdn.download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img $source openrc.sh $glance image-create --name "cirros" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress $glance image-list

$mysql -u root -p

$ CREATE DATABASE nova;

$GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack';

$GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack';

$exit

$ source openrc.sh

$keystone user-create --name nova --pass openstack

$keystone user-role-add --user nova --tenant service --role admin

$ 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/%(tenant_id)s --internalurl http://controller:8774/v2/%(tenant_id)s --adminurl http://controller:8774/v2/%(tenant_id)s --region regionOne

$ apt-get install nova-api $ apt-get install nova-cert $ apt-get install nova-conductor $ apt-get install nova-consoleauth $ apt-get install nova-novncproxy $ apt-get install nova-scheduler $ apt-get install python-novaclient

$sudo nano /etc/nova/nova.conf [DEFAULT] ..... rpc_backend = rabbit rabbit_host = controller rabbit_password = openstack

auth_strategy = keystone

my_ip = 192.168.40.142 vncserver_listen = 192.168.40.142 vncserver_proxyclient_address = 192.168.40.142

[database] connection = mysql://nova:openstack@controller/nova

[keystone_authtoken] auth_host = controller auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = openstack

[glance] host = controller

$sudo nova-manage db sync

$sudo rm -f /var/lib/nova/nova.sqlite

$ service nova-api restart $service nova-cert restart $service nova-consoleauth restart $service nova-scheduler restart $service nova-conductor restart $service nova-novncproxy restart

在Compute 节点上: $apt-get install nova-compute sysfsutils $ nano /etc/nova/nova.conf [DEFAULT] ..... rpc_backend = rabbit rabbit_host = controller rabbit_password = openstack

auth_strategy = keystone

my_ip = 192.168.40.141

vnc_enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = 192.168.40.141 novncproxy_base_url = http://controller:6080/vnc_auto.html

[keystone_authtoken] ... auth_host = controller auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = glance admin_password = openstack

[glance] ... host = controller

$ egrep -c '(vmx|svm)' /proc/cpuinfo


如果你执行此命令0值,你的compute节点不支持hard-ware acceleration, 你必须修改libvirt配置,将KVM换成QEMU


$nano /etc/nova/nova-compute.conf [libvirt] ... virt_type = qemu

$service nova-compute restart $rm -f /var/lib/nova/nova.sqlite

在Controller节点上: $source openrc.sh $nova service-list $nova image-list

以上是“vmware如何安装openstack并安装mysql,keyston glance,nova”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


新闻名称:vmware如何安装openstack并安装mysql,keystonglance,nova
网页URL:http://cqcxhl.cn/article/jhscge.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP