我正在使用Helm Charts(https://github.com/helm/charts/tree/master/stable/locust)在Kubernetes上部署Locust
2个工作pods正在运行,没有错误,但master处于CrashLoopBackOff状态。
当我检查故障pod的日志时,我看到以下错误:
[2020-10-07 21:46:18,300] locust-master-5bf8d86867-kfxxg/ERROR/stderr: Traceback (most recent call last):
[2020-10-07 21:46:18,300] locust-master-5bf8d86867-kfxxg/ERROR/stderr: File "/usr/local/bin/locust", line 11, in <module>
[2020-10-07 21:46:18,300] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,300] locust-master-5bf8d86867-kfxxg/ERROR/stderr: sys.exit(main())
[2020-10-07 21:46:18,300] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr: File "/usr/local/lib/python3.7/site-packages/locust/main.py", line 391, in main
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr: docstring, locusts = load_locustfile(locustfile)
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr: File "/usr/local/lib/python3.7/site-packages/locust/main.py", line 358, in load_locustfile
[2020-10-07 21:46:18,301] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: imported = __import__(os.path.splitext(locustfile)[0])
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: File "/locust-tasks/tasks.py", line 1, in <module>
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: from locust import HttpUser, task, TaskSet, between
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr:
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: ImportError
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: :
[2020-10-07 21:46:18,302] locust-master-5bf8d86867-kfxxg/ERROR/stderr: cannot import name 'HttpUser' from 'locust' (/usr/local/lib/python3.7/site-packages/locust/__init__.py)
[2020-10-07 21:46:18,303] locust-master-5bf8d86867-kfxxg/ERROR/stderr:如果有人能帮我理解我做错了什么,我将不胜感激。我的想法是,我正在使用HttpUser,并且在我拉取的图像中(greenbirdit/locust)仍然是LocustUser,但我不知道如何修复它。
感谢您的帮助!
发布于 2020-10-08 06:31:02
您指向Locust Helm Chart的链接显示它使用的是Locust容器0.9.0。在蝗虫1.0之前,HttpUser是HttpLocust。您可以在此处查看0.9.0的文档:https://docs.locust.io/en/0.9.0/
我不使用Helm,但在Helm更新图表以使用1.0+之前,看起来您肯定会想要重写您的locustfile以使用HttpLocust和其他1.0版本之前的API。
https://stackoverflow.com/questions/64253006
复制相似问题