HttpRunner 阿里云机器上执行 locusts 命令出现 OSError: [Errno 97] Address family not supported by protocol

暴走喵 · 2019年02月28日 · 最后由 深圳-Max 回复于 2019年07月26日 · 3064 次阅读

问题描述:
在学习 httprunner,想试验下性能测试,写完用例后执行命令:locusts -f test_wx_report_from_id.json。在自己的 pc 上可以启动 locusts 成功,但是在阿里云机器上出现如下错误:
ERROR OSError: [Errno 97] Address family not supported by protocol
有没有遇到过类似问题的同学,求指点

共收到 2 条回复 时间 点赞

原因是云服务器有两个 ip 地址造成的
启动的时候指定 ip 地址就可以了, 内网 ip 就可以了
--web-host=12.7.0.1

locust3 -f data/script_file/LC_S000001.py --web-host=127.0.0.1
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册