next up previous contents
Next: 建立 cinder-volumes group Up: 區塊儲存 Cinder Previous: Cinder 安裝   Contents

Cinder 服務啟動

  1. 啟動並設定開機自動啟動 openstack-cinder-scheduler, openstack-cinder-api 及 openstack-cinder-volume 服務。
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-scheduler start
    Starting openstack-cinder-scheduler:               [  OK  ]
    [root@kvm4 ~(keystone_admin)]# chkconfig openstack-cinder-scheduler on
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-api start
    Starting openstack-cinder-api:                     [  OK  ]
    [root@kvm4 ~(keystone_admin)]# chkconfig openstack-cinder-api on
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-volume start
    Starting openstack-cinder-volume:                  [  OK  ]
    [root@kvm4 ~(keystone_admin)]# chkconfig openstack-cinder-volume on
    
  2. 查看 cinder 服務的錯誤訊息。
    [root@kvm4 ~(keystone_admin)]# tail /var/log/cinder/*
    ==> /var/log/cinder/api.log <==
    
    ==> /var/log/cinder/cinder-manage.log <==
    
    ==> /var/log/cinder/scheduler.log <==
    
    ==> /var/log/cinder/volume.log <==
        self.driver.check_for_setup_error()
      File "/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py", line 76, in check_for_setup_error
        run_as_root=True)
      File "/usr/lib/python2.6/site-packages/cinder/utils.py", line 190, in execute
        cmd=' '.join(cmd))
    ProcessExecutionError: Unexpected error while running command.
    Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf vgs --noheadings -o name
    Exit code: 1
    Stdout: ''
    Stderr: 'sudo: sorry, you must have a tty to run sudo\n'
    
  3. 以上錯誤訊息為用戶 cinder 無法使用 sudo 執行 cinder-rootwrap,必須 visudo 增加其權限。
    [root@kvm4 ~(keystone_admin)]# visudo
    Defaults:cinder !requiretty
    cinder ALL = (root) NOPASSWD: /usr/bin/cinder-rootwrap /etc/cinder/rootwrap.conf *
    
  4. 其實 cinder, nova, quantum 等套件安裝時,已將必須以 sudo 執行的命令權限寫在 /etc/sudoers.d 目錄下,但因 /etc/sudoers 沒有將此目錄包含進去,造成執行失敗。執行 visudo 在最後面加入 #includedir /etc/sudoers.d,注意最前面的符號 #不是註解,一定要存在。
    [root@kvm4 ~(keystone_admin)]# ll /etc/sudoers.d/
    total 12
    -r--r-----. 1 root root 111 Jan 25 15:36 cinder
    
    [root@kvm4 ~(keystone_admin)]# visudo
    [root@kvm4 ~(keystone_admin)]# grep includedir /etc/sudoers
    #includedir /etc/sudoers.d
    
  5. 刪除紀錄檔,再重新啟動 openstack-cinder-scheduler, openstack-cinder-api 及 openstack-cinder-volume 服務。
    [root@kvm4 ~(keystone_admin)]# rm -f /var/log/cinder/*
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-scheduler restart
    Stopping openstack-cinder-scheduler:               [  OK  ]
    Starting openstack-cinder-scheduler:               [  OK  ]
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-api restart
    Stopping openstack-cinder-api:                     [  OK  ]
    Starting openstack-cinder-api:                     [  OK  ]
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/openstack-cinder-volume restart
    Stopping openstack-cinder-volume:                  [FAILED]
    Starting openstack-cinder-volume:                  [  OK  ]
    
  6. 再查看 cinder 服務的紀錄,已無錯誤訊息。
    [root@kvm4 ~(keystone_admin)]# tail /var/log/cinder/*
    ==> /var/log/cinder/api.log <==
    
    ==> /var/log/cinder/scheduler.log <==
    2014-01-25 06:07:01 CRITICAL [cinder] need more than 0 values to unpack
    
    ==> /var/log/cinder/volume.log <==
    
  7. 編輯 /etc/tgt/targets.conf,設定 ISCSI 包含 cinder volumes。
    [root@kvm4 ~(keystone_admin)]# echo 'include /etc/cinder/volumes/*' >> /etc/tgt/targets.conf
    
  8. 啟動 tgtd 服務,並設定開機自動啟動。
    [root@kvm4 ~(keystone_admin)]# /etc/init.d/tgtd start
    Starting SCSI target daemon:                       [  OK  ]
    [root@kvm4 ~(keystone_admin)]# chkconfig tgtd on
    
  9. 檢查是否有錯?
    [root@kvm4 ~(keystone_admin)]# tail /var/log/messages 
    Jan 25 06:53:36 kvm4 tgtd: semkey 0x6102fbaf
    Jan 25 06:53:36 kvm4 tgtd: tgtd daemon started, pid:24650
    Jan 25 06:53:36 kvm4 tgtd: tgtd logger started, pid:24653 debug:0
    Jan 25 06:53:36 kvm4 tgtd: work_timer_start(146) use timer_fd based scheduler
    Jan 25 06:53:36 kvm4 tgtd: bs_init(313) use signalfd notification
    
  10. 檢查 openstack 服務的狀態。
    [root@kvm4 ~(keystone_admin)]# openstack-status 
    == Glance services ==
    openstack-glance-api:         active
    openstack-glance-registry:    active
    == Keystone service ==
    openstack-keystone:           active
    == Swift services ==
    openstack-swift-proxy:        active
    openstack-swift-account:      active
    openstack-swift-container:    active
    openstack-swift-object:       active
    == Cinder services ==
    openstack-cinder-api:         active
    openstack-cinder-scheduler:   active
    openstack-cinder-volume:      active
    == Support services ==
    mysqld:                       active
    tgtd:                         active
    qpidd:                        active
    memcached:                    active
    



2015-12-29