您好,登錄后才能下訂單哦!
小編給大家分享一下vmware如何安裝openstack并安裝mysql,keyston glance,nova,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
用vmware 創(chuàng)建三臺虛擬機,分別命名:controller, compute, network. 在controller節(jié)點上: 1.sudo nano /etc/hostname 2.將 ubuntu 修改為 controller #ubuntu是默認的hostname 3.ifconfig 查看controller 節(jié)點上的IP地址,記住IP地址
在compute節(jié)點上: 1.sudo nano /etc/hostname 2.將 ubuntu 修改為 compute #ubuntu是默認的hostname 3.ifconfig 查看compute 節(jié)點上的IP地址,記住IP地址
在network節(jié)點上: 1.sudo nano /etc/hostname 2.將 ubuntu 修改為 network #ubuntu是默認的hostname 3.ifconfig 查看network節(jié)點上的IP地址,記住IP地址
三個節(jié)點修改hostname后執(zhí)行reboot
在三個節(jié)點上同樣操作: 1.sudo nano /etc/hosts 2.添加三個IP地址,剛才記錄的: 192.168.40.142 controller 192.168.40.141 compute 192.168.40.143 network
在三個節(jié)點是都執(zhí)行 sudo service networking restart
執(zhí)行后各自執(zhí)行ping命令,ping其余兩臺的hostname,看是否能ping通
配置好三個虛擬機的節(jié)點后.
在controller節(jié)點上: 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 節(jié)點的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]
connection = mysql://keystone:openstack@controller/keystone ...
這里的openstack 是 keystone 數(shù)據庫密碼 controller 是當前工作節(jié)點的 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
出現(xiàn)錯誤時: Tables "migrate_version" have non utf8 collation, please make sure all tables are CHARSET=utf8 執(zhí)行: 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 節(jié)點上: $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
如果你執(zhí)行此命令0值,你的compute節(jié)點不支持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節(jié)點上: $source openrc.sh $nova service-list $nova image-list
以上是“vmware如何安裝openstack并安裝mysql,keyston glance,nova”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。