设为首页 收藏本站
查看: 895|回复: 0

[经验分享] OpenStack (3)

[复制链接]

尚未签到

发表于 2017-6-26 11:18:55 | 显示全部楼层 |阅读模式
  Installing OpenStack Compute Controller services
  Before creating a server for running OpenStack Compute services for running instances, there are some final services that need be installed on the Controller node where the OpenStack Identity and Image services are running. Separating our Controller services from the Compute nodes allows us to scale our OpenStack environment resources horizontally in the Controller and Compute services.
  install some further packages to the Controller node, which are:
  nova-scheduler: The scheduler picks the server for fulfilling the request to run the instance
nova-api: Service for making requests to OpenStack to operate the services within it; for example, you make a call to this service to start up a new Nova instance
nova-conductor: A new service introduced in the Grizzly release to remove direct database calls by the Compute service
nova-objectstore: File storage service
nova-common: Common Python libraries that underpin all of the OpenStack
environment
nova-cert: The Nova certificate management service, used for authentication to Nova
ntp: Network Time Protocol is essential in a multi-node environment; the nodes must have the same time (tolerance is within five seconds and outside of this you get unpredictable results)
dnsmasq: DNS forwarder and DHCP service that allocates the addresses to your instances in your environment
  vagrant ssh controller
  1. install the required packages
  sudo apt-get update
sudo apt-get -y install rabbitmq-server nova-api nova-conductor nova-scheduler nova-objectstore dnsmasq
  2. install and configure NTP
  sudo apt-get -y install ntp
  3. edit /etc/ntp.conf to keep server times in sync
  # Replace ntp.ubuntu.com with an NTP server on your network
server ntp.ubuntu.com
server 127.127.1.0
fudge 127.127.1.0 stratum 10
  4. restart the service
  sudo service ntp restart
  Creating a sandbox Compute server with VirtualBox and Vagrant
  1. execute the steps in the Creating a sandbox environment with VirtualBox recipe of Chapter1
  2. edit the Vagrant file



# -*- mode: ruby -*-
# vi: set ft=ruby :
nodes = {
'controller'  => [1, 200],
'compute'  => [1, 201],
}
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url ="http://files.vagrantup.com/precise64.box"
nodes.each do |prefix, (count, ip_start)|
count.times do |i|
hostname = "%s" % [prefix, (i+1)]
config.vm.define "#{hostname}" do |box|
box.vm.hostname = "#{hostname}.book"
box.vm.network :private_network, ip: "172.16.0.#{ip_start+i}", :netmask => "255.255.0.0"
box.vm.network :private_network, ip: "10.10.0.#{ip_start+i}", :netmask => "255.255.0.0"
# If using VirtualBox
box.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", 1024]
if prefix == "compute"
vbox.customize ["modifyvm", :id, "--memory", 3172]
vbox.customize ["modifyvm", :id, "--cpus", 2]
end
end
end
end
end
end
  3. power on the compute node
  vagrant up compute
  Installing OpenStack Compute packages
  nova-compute: The main package for running the virtual machine instances.
nova-network: Network service that controls DHCP, DNS, and Routing. This will also
manage and run dnsmasq for us to provide these services.
nova-api-metadata: The Nova API metadata front-end. It is used when we are running a multi-host Nova network in our environment so our compute instances can download metadata.
nova-compute-qemu: Provides QEmu services on our compute host. It is only required where hardware virtualization assist isn't available (as required to run OpenStack under VirtualBox).
ntp: Network Time Protocol is essential in a multi-node environment that the nodes have the same time (tolerance is within five seconds and outside of this you get unpredictable results).
  vagrant ssh compute
  1. install the required packages
  sudo apt-get update
sudo apt-get -y install nova-compute nova-network nova-api-metadata nova-compute-qemu
  2. install and configure NTP
  sudo apt-get -y install ntp
  3. edit /etc/ntp.conf to keep server times in sync
  # Replace ntp.ubuntu.com with an NTP server on your network
server ntp.ubuntu.com
server 127.127.1.0
fudge 127.127.1.0 stratum 10
  4. restart the ntp service
  sudo service ntp restart
  Configuring database services
  OpenStack supports a number of database backends-an internal SQLite database(the default), MySQL, and Postgres.
  vagrant ssh controller
  1. configure a database user of nova for use by OpenStack Compute
  MYSQL_ROOT_PASS=openstack
mysql -uroot -p$MYSQL_ROOT_PASS -e 'CREATE DATABASE nova;'      
  MYSQL_NOVA_PASS=openstack      
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '${MYSQL_NOVA_PASSWORD}';"
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '${MYSQL_NLOVA_PASSWORD}';"
  2. reference MySQL server in /etc/nova/nova.conf file to use MySQL by adding the sql_connection flag
  sql_connection=mysql://nova:openstack@172.16.0.200/nova
  Configuring OpenStack Compute
  vagrant ssh controller
vagrant ssh compute
  1. amend the /etc/nova/nova.conf file to have the following contens
  [DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose=True
  api_paste_config=/etc/nova/api-paste.ini
enabled_apis=ec2,osapi_compute,metadata
  # Libvirt and Virtualization
libvirt_use_virtio_for_bridges=True
connection_type=libvirt
libvirt_type=qemu
  # Database
sql_connection=mysql://nova:openstack@172.16.0.200/nova
  # Messaging
rabbit_host=172.16.0.200
  # EC2 API Flags
ec2_host=172.16.0.200
ec2_dmz_host=172.16.0.200
ec2_private_dns_show_ip=True
  # Networking
public_interface=eth1
force_dhcp_release=True
auto_assign_floating_ip=True
  # Images
image_service=nova.image.glance.GlanceImageService
glance_api_servers=172.16.0.200:9292
  # Scheduler
scheduler_default_filters=AllHostsFilter
  # Object Storage
iscsi_helper=tgtadm
  # Auth
auth_strategy=keystone
  2. Repeat Step 1 and create the file /etc/nova/nova.conf on the Compute host.
  3. back on the controller host
  sudo nova-manage db sync
  4. create the privat enetwork
  sudo nova-mange network create privateNet --fixed_range_v4=10.0.10.0/24 --network_size=64 --bridge_interface=eth2
  5. set a public network range
  sudo nova-manage floating create --ip_range=172.16.10.0/24

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388178-1-1.html 上篇帖子: openstack-L版安装 下篇帖子: 【openstack N版】——创建云主机
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表