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

[经验分享] OpenStack Controller HA (3)

[复制链接]

尚未签到

发表于 2015-4-12 14:39:23 | 显示全部楼层 |阅读模式
  3.5.安装配置dashboard
  (1).yum安装dashboard
  [iyunv@controller01 ~]# yum -y install openstack-dashboard
  (2).修改dashboard配置文件
  [iyunv@controller01 ~]# cp -av /etc/openstack-dashboard/local_settings /etc/openstack-dashboard/local_settings_bak
  [iyunv@controller01 ~]# vi /etc/openstack-dashboard/local_settings
  
  #------------------------------------------------------------------------------------------------------------
  DEBUG = False
  ------->
  DEBUG = True
  #------------------------------------------------------------------------------------------------------------
  ALLOWED_HOSTS = ['horizon.example.com', 'localhost']
  ------->
  ALLOWED_HOSTS = ['horizon.example.com', 'localhost', '*']
  #------------------------------------------------------------------------------------------------------------
  OPENSTACK_HOST = "127.0.0.1"
  ------->
  OPENSTACK_HOST = "192.168.20.20"
  #------------------------------------------------------------------------------------------------------------
  SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
  ------->
  #SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
  SECRET_KEY = 'y3kT2DLiL1/n7cH/NbmfxA='
  SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
  

  CACHES = {
      'default': {
          'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
          'LOCATION' : ['192.168.20.21:11211','192.168.20.22:11211'],
      },
  }
  #------------------------------------------------------------------------------------------------------------
  CACHES = {
      'default': {
          'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache'
      }
  }
  ------->
  #CACHES = {
  #    'default': {
  #        'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache'
  #    }
  #}
  #------------------------------------------------------------------------------------------------------------
  (3).修改httpd配置文件
  [iyunv@controller01 ~]# cp -av /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_bak

  
  [iyunv@controller01 ~]# vi /etc/httpd/conf/httpd.conf
  #Listen 12.34.56.78:80
  Listen 192.168.20.21:80
  #ServerName www.example.com:80
  ServerName 192.168.20.21:80
  
[iyunv@controller02 ~]# vi /etc/httpd/conf/httpd.conf
#Listen 12.34.56.78:80
Listen 192.168.20.22:80
#ServerName www.example.com:80
ServerName 192.168.20.22:80
(4).启动dashboard
[iyunv@controller01 ~]# service httpd start
[iyunv@controller01 ~]# chkconfig httpd on

[iyunv@controller01 ~]# service memcached start
[iyunv@controller01 ~]# chkconfig memcached on
(5).设置Iptables:

  [iyunv@controller01 ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
  [iyunv@controller01 ~]# iptables -I INPUT -p tcp -m multiport --dports 5900:6000 -j ACCEPT
  [iyunv@controller01 ~]# iptables -I INPUT -p tcp --dport 6080 -j ACCEPT
  [iyunv@controller01 ~]# service iptables save



3.6.安装配置cinder
(1).yum安装cinder
[iyunv@controller01 ~]# yum -y install openstack-cinder openstack-selinux

(2).创建user、定义services和endpoint
  
  [iyunv@controller01 ~]# keystone user-create --name=cinder --pass=service --email=cinder@chensh.net
  [iyunv@controller01 ~]# keystone user-role-add --user=cinder --tenant=service --role=admin
  [iyunv@controller01 ~]# vi /root/config/cinder-user.sh
  #!/bin/sh
  my_ip=controller
  keystone service-create --name=cinder --type=volume --description="Cinder Volume Service"
  service=$(keystone service-list | awk '/volume/ {print $2}')
  keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v1/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v1/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v1/%\(tenant_id\)s
  keystone service-create --name=cinder --type=volumev2 --description="Cinder Volume Service V2"
  service=$(keystone service-list | awk '/volumev2/ {print $2}')
  keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v2/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v2/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v2/%\(tenant_id\)s
  [iyunv@controller01 ~]# sh /root/config/cinder-user.sh
  (3).定义cinder配置文件
  [iyunv@controller01 ~]# cp -av /etc/cinder/cinder.conf /etc/cinder/cinder.conf_bak
  [iyunv@controller01 ~]# sed -i '/^#/d' /etc/cinder/cinder.conf
  [iyunv@controller01 ~]# sed -i '/^$/d' /etc/cinder/cinder.conf
  [iyunv@controller01 ~]# vi /etc/cinder/cinder.conf
  
  [DEFAULT]
  osapi_volume_listen = controller01
  osapi_volume_listen_port = 8776
  log_dir = /var/log/cinder
  state_path = /var/lib/cinder
  lock_path = /var/lib/cinder/tmp
  #volumes_dir=/openstack/cinder/volumes
  iscsi_helper = tgtadm
  #connection = mysql://cinder:cinder@mysqlserver/cinder
  volume_driver = cinder.volume.drivers.glusterfs.GlusterfsDriver
  glusterfs_shares_config = /etc/cinder/shares.conf
  glusterfs_mount_point_base = /openstack/cinder/volumes
  notification_driver = cinder.openstack.common.notifier.rpc_notifier
  control_exchange = cinder
  rpc_backend = cinder.openstack.common.rpc.impl_qpid
  qpid_hostname = controller01
  auth_strategy = keystone
  [BRCD_FABRIC_EXAMPLE]
  [database]
  connection = mysql://cinder:cinder@mysqlserver/cinder
  [fc-zone-manager]
  [keymgr]
  [keystone_authtoken]
  [matchmaker_ring]
  [ssl]
  
[iyunv@controller02 ~]# vi /etc/cinder/cinder.conf

[DEFAULT]
osapi_volume_listen = controller02
osapi_volume_listen_port = 8776
log_dir = /var/log/cinder
state_path = /var/lib/cinder
lock_path = /var/lib/cinder/tmp
#volumes_dir=/openstack/cinder/volumes
iscsi_helper = tgtadm
#connection = mysql://cinder:cinder@mysqlserver/cinder
volume_driver = cinder.volume.drivers.glusterfs.GlusterfsDriver
glusterfs_shares_config = /etc/cinder/shares.conf
glusterfs_mount_point_base = /openstack/cinder/volumes
notification_driver = cinder.openstack.common.notifier.rpc_notifier
control_exchange = cinder
rpc_backend = cinder.openstack.common.rpc.impl_qpid
qpid_hostname = controller02
auth_strategy = keystone
[BRCD_FABRIC_EXAMPLE]
[database]
connection = mysql://cinder:cinder@mysqlserver/cinder
[fc-zone-manager]
[keymgr]
[keystone_authtoken]
[matchmaker_ring]
[ssl]
  
  [iyunv@controller01 ~]# cp -av /etc/cinder/api-paste.ini /etc/cinder/api-paste.ini_bak
  [iyunv@controller01 ~]# vi /etc/cinder/api-paste.ini
  auth_host = controller
  auth_port = 35357
  auth_protocol = http
  admin_user = cinder
  admin_tenant_name = service
  admin_password = service
  (4).修改cinder数据存储路径
  [iyunv@controller01 ~]# grep -q /openstack/cinder/volumes /etc/tgt/targets.conf || sed -i '1iinclude /openstack/cinder/volumes/*' /etc/tgt/targets.conf
  
  (5).同步cinder数据库
  [iyunv@controller01 ~]# cinder-manage db sync
  (6).启动cinder相关服务
  [iyunv@controller01 ~]# service tgtd start
  [iyunv@controller01 ~]# chkconfig tgtd on
  [iyunv@controller01 ~]# service openstack-cinder-api start
  [iyunv@controller01 ~]# service openstack-cinder-scheduler start
  [iyunv@controller01 ~]# service openstack-cinder-volume start
  [iyunv@controller01 ~]# chkconfig openstack-cinder-api on
  [iyunv@controller01 ~]# chkconfig openstack-cinder-scheduler on
  [iyunv@controller01 ~]# chkconfig openstack-cinder-volume on
  

运维网声明 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-56343-1-1.html 上篇帖子: Openstack-Ceilometer-Alarm运行机制 下篇帖子: OpenStack 添加镜像
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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