环境
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
- bootstrap_host_data_disk_device != None
无法获取磁盘信息而出错,导致计算磁盘可用空间为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目录下。