1、执行awx-manage命令报错
django.db.utils.OperationalError: FATAL: role “root” does not exist
原因:
postgresql是不允许使用root用户启动服务的,所以必须切换到其他用户下才可以进行正常的服务启动,但是有些时候我们又需要使用root用户来使用postgresql
解决方法:
1、手动创建root role,我这里是使用用户名为postgres来启动postgresql服务的
su postgres
# 创建root用户
-bash-4.2$ psql -U postgres
postgres=#create user root with password ‘password’;
CREATE ROLE
将数据库权限赋予root用户
postgres=# GRANT ALL PRIVILEGES ON DATABASE awx to root;
GRANT
将用户修改为超级用户(看实际需求)
postgres=# ALTER ROLE root WITH SUPERUSER;
postgres=# \q
注意:awx 是本次awx部署时的数据库名称,可以通过ansible-install-packages/ansible.sh中查询到
sudo -u postgres createdb -O awx awx
