Magnum安装配置
从源码安装Magnum https://docs.openstack.org/magnum/latest/install/install-guide-from-source.html
swarm-cluster创建超时
现象就是swarm-master一直显示在创建中,然后超过60分钟后,显示创建失败,heat显示的错误是Timeout
解决方法:
超时问题是因为虚拟机中解析不到controller对应的IP地址,需要讲keystone, heat, magnum 的 public endpoint改成 IP地址。
swarm-manager service failed to start
创建swarm-master是,提示swarm-manager服务启动失败,登录到虚拟机内发现etcd,swarm-manager服务都启动失败,etcd启动失败的原因是 “open /etc/docker/server.crt: no such file or directory” ,正常的/etc/docker/下面应该有三个证书文件,但错误的虚拟机里只有一个。
错误日志 : /var/log/message
1 | 2017-11-02 15:41:35.325 24030 WARNING magnum.common.keystone [req-1f4cec3b-d7a7-4143-825a-728cda9b1a7d - - - - -] Auth plugin and its options for service user must be provided in [keystone_auth] section. Using values from [keystone_authtoken] section is deprecated.: MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url |
虚拟机服务状态
1 | [fedora@swarm-cluster-i7bkbockqyvu-master-0 ~]$ sudo systemctl start swarm-manager |
Cloud-init 日志 : /var/log/cloud-init-output.log
1 | Cloud-init v. 0.7.9 running 'modules:config' at Thu, 02 Nov 2017 02:07:02 +0000. Up 39.38 seconds. |
解决方法:
虚拟机初始化代码出错位置
1 | def write_server_cert(config, csr_req): |
从出错的位置可以看出,就是虚拟机请求certificates时出了问题。在Postman中测试,先生成token,再请求certificates
User Token
1 | -- POST http://10.10.80.10:5000/v3/auth/tokens |
Get Certificates : 正确的返回
正确的返回是一个json格式的数据,里面有”pem”这一项,刚好是虚拟机初始化时报错的地方
1 | -- GET http://10.10.80.10:9511/v1/certificates/[CLUSTER_ID] |
Get Certificates : 错误的返回
错误返回代码是500,导致我一直以为是magnum代码写的有问题,所以就有了后面一步一步的调试
1 | 2017-11-02 16:38:33.134 5048 ERROR wsme.api [req-4f45fd22-5b2d-4a24-9e93-08b7bfa95e12 15edc195e4bb4b50bf3c26b0bb5e3b09 - 53bd6f95db004eb3807c66fcbaa45300 - -] Server-side error: "Remote error: BadRequest Invalid input for field 'identity/password/user/password': None is not of type 'string' |
其实在最开始的日志中就提示了问题所在 “ Auth plugin and its options for service user must be provided in [keystone_auth] section. Using values from [keystone_authtoken] section is deprecated.: MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url”, 不过错误等级是WARNING,所以一直被我忽略掉,后来一步一步调试代码又定位到了这个问题。
解决办法就是配置 /etc/magnum/magnum.conf 中 keystone_auth项
1 | [keystone_auth] |