我有一个带有三个节点的Cassandra集群,其中两个节点已启动.他们都在同一个DC.当我的Java应用程序写入集群时,我的应用程序出现错误,似乎是由Cassandra的一些问题引起的:
引起:com.datastax.driver.core.exceptions.UnavailableException:在com.datastax.driver.core.exceptions.UnavailableException.copy(UnavailableException.java)中,在一致性ONE(需要1但只有0)的查询中没有足够的副本可用于查询:79)
没有意义的部分是"1需要但只有0活着"的声明.有两个节点,这意味着一个节点应该"活着"进行复制.
或者我误解了错误信息?
谢谢.
我正在考虑使用AWS自动扩展来根据各种性能指标(CPU等)上下扩展我的基础架构.我知道如何设置它; 但是,我不喜欢在缩小时终止而不是停止实例.这意味着当我缩放时,我必须从头开始使用新实例并重新安装我的软件等.我宁愿只是根据需要启动/停止我的实例而不是创建/终止.有没有办法做到这一点?
与 Splunk 相比,这更像是一个 Python 问题,但如果有人这样做的话将会很有帮助......特别是在这里,有一个关于在单个 POST 中向服务器发送多个指标的讨论。他们提供的示例是使用curl 并将整个有效负载用单引号(\')括起来,例如
\n\ncurl -k http://<IP address or host name or load balancer name>:8088/services/collector \\\n-H "Authorization: Splunk 98a1e071-bc35-410b-8642-78ce7d829083" \n\\\n-d \'{"time": 1505501013.000,"source":"disk","host":"host_99","fields": \n{"region":"us-west-1","datacenter":"us-west- 1a","rack":"63","os":"Ubuntu16.10","arch":"x64","team":"LON","service":"6","service_version":"0","service_environment":"test","path":"/dev/sda1","fstype":"ext3","_value":999311222774,"metric_name":"total"}}\n{"time": 1505511013.000,"source":"disk","host":"host_99","fields": \n{"region":"us-west-1","datacenter":"us-west-1a","rack":"63","os":"Ubuntu16.10","arch":"x64","team":"LON","service":"6","service_version":"0","service_environment":"test","path":"/dev/sda1","fstype":"ext3","_value":1099511627776,"metric_name":"total"}}\'\nRun Code Online (Sandbox Code Playgroud)\n\n我的问题是如何在 python \xe2\x80\x93 中执行相同的操作,即您不能像在curl命令中那样将多个JSON对象用单引号括起来 - 这只会使整个有效负载成为字符串。是否有其他包装可以用于此目的?
\n\n所以,这有效:
\n\npayload = {"time": 1505501013.000,"source":"disk","host":"host_99","fields": \n{"region":"us-west-1","datacenter":"us-west- 1a","rack":"63","os":"Ubuntu16.10","arch":"x64","team":"LON","service":"6","service_version":"0","service_environment":"test","path":"/dev/sda1","fstype":"ext3","_value":999311222774,"metric_name":"total"}}\nRun Code Online (Sandbox Code Playgroud)\n\n但这并不:
\n\npayload = {"time": 1505501013.000,"source":"disk","host":"host_99","fields": \n{"region":"us-west-1","datacenter":"us-west- 1a","rack":"63","os":"Ubuntu16.10","arch":"x64","team":"LON","service":"6","service_version":"0","service_environment":"test","path":"/dev/sda1","fstype":"ext3","_value":999311222774,"metric_name":"total"}}\n {"time": 1505511013.000,"source":"disk","host":"host_99","fields": \n{"region":"us-west-1","datacenter":"us-west-1a","rack":"63","os":"Ubuntu16.10","arch":"x64","team":"LON","service":"6","service_version":"0","service_environment":"test","path":"/dev/sda1","fstype":"ext3","_value":1099511627776,"metric_name":"total"}}\nRun Code Online (Sandbox Code Playgroud)\n\n仅供参考,那么 POST 看起来像:
\n\n resp = requests.post(splunkurl,json=payload,headers=headers)\nRun Code Online (Sandbox Code Playgroud)\n