【发布时间】:2017-01-27 02:24:58
【问题描述】:
我有一个用 Spring Boot 编写的 REST 服务,它只有 GET 和 POST 方法。 GET/POST 方法从/向 cassandra 集群检索/发布数据。 我尝试用 100 个用户同时运行来测试 REST 服务。 我的 jmeter 配置是:
当我运行这个测试时,对于前几个请求,它会给出错误,而一半的请求是成功的。 这是结果表
然后我在结果树中查看了错误原因,发现了这个响应数据:
{"timestamp":1474278650822,"status":500,"error":"Internal Server Error","exception":"com.datastax.driver.core.exceptions.NoHostAvailableException","message":"org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)","path":"/post"}
我不明白为什么它在最初的几个请求中无法连接到 cassandra 集群。
我是 cassandra、REST 服务和 jmeter 的新手。谁能指出我犯了什么错误。 注意:我已经使用Postman 测试了我的 REST 服务,它的 GET 和 POST 请求都运行良好。
【问题讨论】:
标签: spring rest spring-boot cassandra jmeter