使用koa-body遇到的坑
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用koa-body遇到的坑相关的知识,希望对你有一定的参考价值。
参考技术A koa-body可以实现文件上传,同时也可以让koa能获取post请求的参数,在使用的过程中,遇到了一下的坑查了很久没有搞明白是什么原因,后来把koa-bodyParser注释掉就行了,估计是koa-body跟koa-bodyParser冲突了,它们都可以获取post请求参数,所有用了koa-body就不需要用koa-bodyParser了。
原因是我封装了一个中间件,
用来同时获取get和post请求参数,顺序(中间件是有顺序的)放错了,放在koa-body后面就行了。
packstack 部署遇到的坑
centos7 部署icehouse 遇到了好多坑
第一次安装使用 使用 packstack --allinone 失败
重复安装的时候使用第一次生成的 answer-file
packstack --answer-file=/root/packstack-answers-20161115-033728.txt
SequenceError: Error appeared during Puppet run: 10.0.4.15_mariadb.pp
Error: mysqladmin -u root password ‘5c2dcec12fcb4538‘ returned 1 instead of one of [0]^[[0m
You will find full trace in log /var/tmp/packstack/20161115-031426-zz2wLu/manifests/10.0.4.15_mariadb.pp.log
在 10.0.4.15_mariadb.pp.log 中发现
ESC[mNotice: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/returns: ^Gmysqladmin: connect to server at ‘localhost‘ failedESC[0m
ESC[mNotice: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/returns: error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: NO)‘ESC[0m
解决办法:
给mariadb的root设置密码,并修改answer-file 中的 CONFIG_MARIADB_PW 为mariadb 的root密码
# Password for the MariaDB admin user
CONFIG_MARIADB_PW=123
10.0.4.15_osclient.pp: [ ERROR ]
Applying Puppet manifests [ ERROR ]
ERROR : Error appeared during Puppet run: 10.0.4.15_osclient.pp
Error: Execution of ‘/usr/bin/yum -d 0 -e 0 -y list python-iso8601‘ returned 1: Error: No matching Packages to list
You will find full trace in log /var/tmp/packstack/20161115-051053-4LYnuR/manifests/10.0.4.15_osclient.pp.log
Please check log file /var/tmp/packstack/20161115-051053-4LYnuR/openstack-setup.log for more information
解决办法:将 /usr/lib/python2.7/site-packages/packstack/puppet/templates/openstack_client.pp 中的 python-iso8601 替换成 python2-iso8601
sed -i ‘s/python-iso8601/python2-iso8601/‘ /usr/lib/python2.7/site-packages/packstack/puppet/templates/openstack_client.pp
_mongodb.pp: [ ERROR ]
Applying Puppet manifests [ ERROR ]
ERROR : Error appeared during Puppet run: 10.0.4.15_mongodb.pp
Error: Could not start Service[mongodb]: Execution of ‘/usr/bin/systemctl start mongod‘ returned 1: Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details.
You will find full trace in log /var/tmp/packstack/20161115-054317-dIhK2C/manifests/10.0.4.15_mongodb.pp.log
原因是mongodb 没启动起来
查看mongodb的日志,会看到这么一行 Insufficient free space for journal files ,原因是因为mongo的journa目录下空间小于3379MB ,
解决办法:
修改配置文件 /etc/mongod.conf
vi /etc/mongod.conf
# Use a smaller default file size (false by default)
smallfiles = true # 修改这里就可以了
_ring_swift.pp: [ ERROR ]
Applying Puppet manifests [ ERROR ]
ERROR : Error appeared during Puppet run: 10.0.4.15_ring_swift.pp
Error: Execution of ‘/usr/bin/swift-ring-builder /etc/swift/object.builder add r1z1-10.0.4.15:6000/swift_loopback 10.00‘ returned 2: Device 0 already uses 10.0.4.15:6000/swift.
You will find full trace in log /var/tmp/packstack/20161115-060907-lLsOLD/manifests/10.0.4.15_ring_swift.pp.log
Please check log file /var/tmp/packstack/20161115-060907-lLsOLD/openstack-setup.log for more information
mkdir /tmp/bak
mv /etc/swift/*.builder /tmp/bak
mv /etc/swift/*.ring.gz /tmp/bak
mv /etc/swift/backups /tmp/bak
以上是关于使用koa-body遇到的坑的主要内容,如果未能解决你的问题,请参考以下文章