openstack pike + ceph +高可用集成 -- Nova计算节点安装配置 (十三)

# computer1 安装配置
########################################
yum install python-openstackclient openstack-selinux -y
yum install python-openstackclient python2-PyMySQL -y #OpenStack客户端
yum install openstack-utils -y #openstack工具
#安装Nova
yum install -y openstack-nova-compute
yum install -y python-openstackclient openstack-selinux
#安装Neutron
yum install -y openstack-neutron-linuxbridge ebtables ipset

#备份默认配置
cp /etc/nova/nova.conf{,.bak}
cp /etc/neutron/neutron.conf{,.bak}
cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,bak}

#设置Nova实例路径(磁盘镜像文件)
Vdir=/date/nova
VHD=$Vdir/instances
mkdir -p $VHD
chown -R nova:nova $Vdir

Netname=em1  #网卡名
IP=192.168.0.54

#使用QEMU或KVM ,KVM硬件加速需要硬件支持,虚拟机使用 qemu  看个人情况 我是物理机 所以得到的是 kvm
[[ `egrep -c '(vmx|svm)' /proc/cpuinfo` = 0 ]] && { Kvm=qemu; } || { Kvm=kvm; }
echo "使用 $Kvm"

VncProxy=192.168.0.71 #vip地址


###配置 ceph集成参数设置 不记得的去cinder.conf查看自己生成的UID
MyUID=5d8bc172-d375-4631-8be0-cbe11bf88a55


#配置 nova
echo '
#
[DEFAULT]
instances_path='$VHD'
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack@controller:5673
my_ip = '$IP'
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
cpu_allocation_ratio = 16.0

####优化实施#######

#token缓存时间
revocation_cache_time=1200
#节省每次加载白名单的时间
use_rootwrap_daemon=True
#限制由nova-compute并发运行的实例构建的最大数量
max_concurrent_builds=100
#可以同时运行的最大活动迁移数量
max_concurrent_live_migrations=100
#可用于同步电源状态的greenthread数量
sync_power_state_pool_size=2000
#在图像缓存管理器运行之间等待的秒数
image_cache_manager_interval=10000
#超过20分钟 创建实例返回失败
instance_build_timeout=1200
#OpenStack API服务的工作人员数量。
osapi_compute_workers=16
#元数据服务的工作人员数量
metadata_workers=16


####优化

[api_database]
connection = mysql+pymysql://nova:nova@controller/nova_api
[database]
connection = mysql+pymysql://nova:nova@controller/nova

[api]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
#token缓存时间  20分钟
token_cache_time = 1200



[vnc]
enabled = true
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://'$VncProxy':6080/vnc_auto.html
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = placement


[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
#

[libvirt]
virt_type = '$Kvm'
 
images_type = rbd
images_rbd_pool = vms
images_rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_user = cinder
rbd_secret_uuid = '$MyUID'
disk_cachemodes="network=writeback"
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
#禁用文件注入#
libvirt_inject_password = false
libvirt_inject_key = false
libvirt_inject_partition = -2
live_migration_downtime = 1000

##'>/etc/nova/nova.conf
View Code

 


#neutron配置
echo '
#
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:openstack@controller:5673

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = neutron

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

#'>/etc/neutron/neutron.conf
View Code

 


# bprovider:网卡名
echo '
[linux_bridge]
physical_interface_mappings = provider:'$Netname'
[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = true
l2_population = true
local_ip = '$IP'
#'>/etc/neutron/plugins/ml2/linuxbridge_agent.ini
View Code

 

#启动
systemctl enable libvirtd.service openstack-nova-compute.service neutron-linuxbridge-agent.service
systemctl restart libvirtd.service openstack-nova-compute.service neutron-linuxbridge-agent.service
#

##启动Cinder 上一篇没有启动
systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service


 

 

###########################
#检测
 
#在openstack管理节点
source admin-openstack.sh
 
#查看cinder是否有@ceph存储
cinder service-list
 
#使用raw磁盘格式,创建镜像
source ./admin-openstack.sh
openstack image create "cirros2" \
  --file cirros-0.3.5-x86_64-disk.img \
  --disk-format raw --container-format bare \
  --public
 
#检查是否上传成功
openstack image list
 
#查看虚拟机列表
openstack server list

 
 
###########################
#在ceph管理节点查看
ceph df
#查看pool
rbd -p vms ls
rbd -p volumes ls
rbd -p images ls
 

 

posted @ 2018-04-03 13:37  小⑦  阅读(390)  评论(0编辑  收藏  举报