Openstack-ansible安裝問題集

環境

openstack Rocky
openstack-ansible 18.1.6
Ubuntu 18.04.2

錯誤處理

安裝Create a domain, projects, users, and roles 第一步報錯

rise@cloud1:~$ openstack domain create --description "An Example Domain" example
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 868, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 741, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 469, in format
    s = self._fmt % record.__dict__
    
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-16: ordinal not in range(128)
Logged from file app.py, line 405

參考 https://www.cnblogs.com/kevingrace/p/5893121.html
https://www.jianshu.com/p/3a2ce134b786

mariadb15權限異常

SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rise' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'keystone'@'%' IDENTIFIED BY 'keystone1001' WITH GRANT OPTION;

` 一定要讓keystone擁有全部權限,僅僅是keystone數據表是不夠的

FLUSH PRIVILEGES;

一定要重啓mysql\mysql\mariadb

service mysql restart
service mariadb restart
service mysqld restart

https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/

openstack domain命令超長運行

openstack domain create --description “An Example Domain” example
執行時間超過二十分鐘

GRANT ALL PRIVILEGES ON . TO ‘glance’@’%’ IDENTIFIED BY ‘glance1001’ WITH GRANT OPTION;

硬盤空間不足問題

修改官方源碼: /opt/openstack-ansible/tests/roles/bootstrap-host/tasks/check-requirements.yml

該文件附屬/opt/openstack-ansible/tests/bootstrap-aio.yml的playbook中,因

  • name: Set data disk facts
    set_fact:
    host_data_disk_sectors: “{{ (ansible_devices[bootstrap_host_data_disk_device][‘sectors’] | int) }}”
    host_data_disk_sectorsize: “{{ (ansible_devices[bootstrap_host_data_disk_device][‘sectorsize’] | int) }}”
    when:
    • bootstrap_host_data_disk_device != None
      tags:
    • check-disk-size

無法獲取磁盤信息而出錯,導致計算磁盤可用空間爲0,這裏附錄一份相關ansible_devices信息:

非常神奇的開發者,計算用扇區乘以每個扇區大小來計算可用磁盤空間,直接讀size屬性就好了啊!!!(黑人問號)

再次修改:爲了保持官方的一致,直接修改register

- name: Identify the space available in /
  # NOTE(hwoarang): df does not work reliably on btrfs filesystems
  # https://btrfs.wiki.kernel.org/index.php/FAQ#How_much_free_space_do_I_have.3F
  # As such, use the btrfs tools to determine the real available size on the
  # disk
  shell: |
    if [[ $(df -T / | tail -n 1 | awk '{print $2}') == "btrfs" ]]; then
        btrfs fi usage --kbytes / | awk '/^.*Free / {print $3}'| sed 's/\..*//'
    else
        df -BK / | awk '!/^Filesystem/ {print $4}' | sed 's/K//' | sed -n "2p"
    fi
  when:
    - bootstrap_host_data_disk_device == None
  changed_when: false
  register: root_space_available
  tags:
    - check-disk-size

在 else語句後追加| sed -n “2p”

googleapi下載失敗問題

/etc/ansible/roles/haproxy_server/tasks/haproxy_install.yml 33 line

翻牆後使用ansible get_url也無效

手動下載放在部署機/opt/cache/files,解決

Failed to start HAProxy Load Balancer.

fatal: [infra1]: FAILED! => {“changed”: false, “msg”: “Unable to restart service haproxy: Job for haproxy.service failed because the control process exited with error code.\nSee “systemctl status haproxy.service” and “journalctl -xe” for details.\n”}

解決辦法

mkdir /run/haproxy

vim /etc/sysctl.conf #修改內核參數

net.ipv4.ip_nonlocal_bind = 1 #沒有就新增此條記錄

sysctl -p #保存結果,使結果生效

磁盤故障

系統無法響應,dell電腦前部指示燈已經亮起

只能手動重啓,硬盤有故障,暫時無法解決

網絡故障

這個沒有好的辦法,只能手動下載放到相應的目錄下。比如一次,cdimage.ubuntu的一個base下載不了,手動下載,放到/tmp目錄下。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章