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

[经验分享] puppet部署openstack(controller)

[复制链接]
发表于 2018-6-2 11:03:09 | 显示全部楼层 |阅读模式
  

  1,准备一台服务器,安装ubuntu12.04系统,用于controller的部署。
  2,compute节点需准备好一个cinder-volumes 的VG。
  3,各节点网卡设置(eth0分配静态地址,用于public和internal网络,eth1手动但不分配地址,用于private网络):
$ /etc/network/interfaces
auto eth1
iface eth1 inetmanual
up ifconfig eth1up  

  4,添加ubuntu cloud源
$ /etc/network/interfaces
auto eth1
iface eth1 inetmanual
up ifconfig eth1up  

  5,添加puppet源
$ wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudodpkg –i puppetlabs-release-precise.deb  6,更新系统
  7,添加puppet别名到/etc/hosts
  8,安装puppet和puppet模块
$ sudo apt-get install puppet puppetmaster
$ sudo puppet module install puppetlabs/openstack  9,vi /etc/puppet/manifests/site.pp:
#
# This document serves as an example of how to deploy
# basic single and multi-node openstack environments.
#
# deploy a script that can be used to test nova
class { 'openstack::test_file': }
####### shared variables ##################
# this section is used to specify global variables thatwill
# be used in the deployment of multi and single nodeopenstack
# environments
# assumes that eth0 is the public interface
$public_interface       = 'eth0'
# assumes that eth1 is the interface that will be usedfor the vm network
# this configuration assumes this interface is active butdoes not have an
# ip address allocated to it.
$private_interface      = 'eth1'
# credentials
$admin_email            = 'root@localhost'
$admin_password         = 'keystone_admin'
$cinder_user_password   = 'cinder_pass'
$cinder_db_password     = 'cinder_pass'
$keystone_db_password   = 'keystone_db_pass'
$keystone_admin_token   = 'keystone_admin_token'
$nova_db_password       = 'nova_pass'
$nova_user_password     = 'nova_pass'
$glance_db_password     = 'glance_pass'
$glance_user_password   = 'glance_pass'
$rabbit_password        = 'openstack_rabbit_password'
$rabbit_user            = 'openstack_rabbit_user'
$fixed_network_range    = '10.0.0.0/24'
$floating_network_range = '192.168.101.64/28'
$secret_key             = 'secret_key'
$mysql_root_password    = 'secret'
# switch this to true to have all service log at verbose
$verbose                = false
# by default it does not enable atomatically addingfloating IPs
$auto_assign_floating_ip = false
#### end shared variables #################
# all nodes whose certname matches openstack_all shouldbe
# deployed as all-in-one openstack installations.
node /openstack_all/ {
include 'apache'
class {'openstack::all':
public_address          =>$ipaddress_eth0,
public_interface        =>$public_interface,
private_interface       =>$private_interface,
admin_email             =>$admin_email,
admin_password          =>$admin_password,
cinder_db_password      =>$cinder_db_password,
cinder_user_password    =>$cinder_user_password,
keystone_db_password    =>$keystone_db_password,
keystone_admin_token    =>$keystone_admin_token,
nova_db_password        =>$nova_db_password,
nova_user_password      =>$nova_user_password,
glance_db_password      =>$glance_db_password,
glance_user_password    =>$glance_user_password,
rabbit_password         =>$rabbit_password,
rabbit_user             =>$rabbit_user,
libvirt_type            =>'kvm',
floating_range          => $floating_network_range,
fixed_range             =>$fixed_network_range,
verbose                 => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
secret_key              => $secret_key,
neutron                 => false,
mysql_root_password     =>$mysql_root_password,
}
class {'openstack::auth_file':
admin_password       =>$admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node      =>'127.0.0.1',
}
}
# multi-node specific parameters
$controller_node_address = '192.168.1.80'
$controller_node_public  = $controller_node_address
$controller_node_internal = $controller_node_address
node /openstack_controller/ {
#  class {'nova::volume': enabled => true }
#  class {'nova::volume::iscsi': }
class {'openstack::controller':
public_address          =>$controller_node_public,
public_interface        =>$public_interface,
private_interface       =>$private_interface,
internal_address        => $controller_node_internal,
floating_range          =>$floating_network_range,
fixed_range             =>$fixed_network_range,
# by default itdoes not enable multi-host mode
multi_host              => true,
# by default isassumes flat dhcp networking mode
network_manager         =>'nova.network.manager.FlatDHCPManager',
verbose                 => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
mysql_root_password     =>$mysql_root_password,
admin_email             =>$admin_email,
admin_password          =>$admin_password,
keystone_db_password    =>$keystone_db_password,
keystone_admin_token    =>$keystone_admin_token,
cinder_db_password      => $cinder_db_password,
cinder_user_password    =>$cinder_user_password,
glance_db_password      =>$glance_db_password,
glance_user_password    =>$glance_user_password,
neutron                 => false,
nova_db_password        => $nova_db_password,
nova_user_password      =>$nova_user_password,
rabbit_password         =>$rabbit_password,
rabbit_user             =>$rabbit_user,
secret_key              => $secret_key,
}
class { 'openstack::auth_file':
admin_password       =>$admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node      =>$controller_node_internal,
}
}
node /openstack_compute/ {
class {'openstack::compute':
public_interface   =>$public_interface,
private_interface  =>$private_interface,
internal_address   =>$ipaddress_eth0,
libvirt_type       => 'kvm',
fixed_range        =>$fixed_network_range,
network_manager    =>'nova.network.manager.FlatDHCPManager',
multi_host         => true,
cinder_db_password => $cinder_db_password,
nova_db_password   =>$nova_db_password,
nova_user_password => $nova_user_password,
neutron            => false,
rabbit_host        => $controller_node_internal,
rabbit_password    =>$rabbit_password,
rabbit_user        =>$rabbit_user,
glance_api_servers => "${controller_node_internal}:9292",
vncproxy_host      =>$controller_node_public,
vnc_enabled        => true,
verbose            => $verbose,
manage_volumes     => true,
volume_group       =>'cinder-volumes'
}
}  10,为controller签发证书:
$ sudo puppet agent –t –-certname openstack_controller
$ sudo puppet cert sign openstack_controller  11,部署controller节点
$ sudo puppet agent –t –certname openstack_controller  12,修改/etc/openstack-dashboard/local_settings.py中的ALLOWED_HOSTS ,设定为 ['*']
  13,重启apache
$ sudo service apache2 restart  14,访问http://192.168.1.80,登录horizon。
  

运维网声明 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-506379-1-1.html 上篇帖子: openstack的安装(二) 安装nova服务同时建立计算节点 下篇帖子: image Modify for kvm , openstack
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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