- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我使用 python 脚本传递给 cassandra 批处理查询,如下所示:
query = 'BEGIN BATCH ' + 'insert into ... ; insert into ... ; insert into ...; ' + ' APPLY BATCH;'
session.execute(query)
它工作了一段时间,但在启动脚本失败后大约 2 分钟内打印:
Traceback (most recent call last):<br>
File "/home/fervid/Desktop/cassandra/scripts/parse_and_save_to_cassandra.cgi", line 127, in <module><br>
session.execute(query)<br>
File "/usr/local/lib/python2.7/dist-packages/cassandra/cluster.py", line 1103, in execute<br>
result = future.result(timeout)<br>
File "/usr/local/lib/python2.7/dist-packages/cassandra/cluster.py", line 2475, in result<br>
raise OperationTimedOut(errors=self._errors, last_host=self._current_host)<br>
cassandra.OperationTimedOut: errors={}, last_host=127.0.0.1<br>
<br>
<br>
我将超时从 cassandra.yaml
更改为:
read_request_timeout_in_ms:15000
range_request_timeout_in_ms:20000
write_request_timeout_in_ms:20000
cas_contention_timeout_in_ms:10000
request_timeout_in_ms:25000
然后我重新启动了cassandra,但没有帮助。错误一次又一次发生!
脚本失败时日志中的行:
INFO [BatchlogTasks:1] 2014-06-11 14:18:10,490 ColumnFamilyStore.java (line 794) Enqueuing flush of Memtable-batchlog@28149592(13557969/13557969 serialized/live bytes, 4 ops)
INFO [FlushWriter:10] 2014-06-11 14:18:10,490 Memtable.java (line 363) Writing Memtable-batchlog@28149592(13557969/13557969 serialized/live bytes, 4 ops)
INFO [FlushWriter:10] 2014-06-11 14:18:10,566 Memtable.java (line 410) Completed flushing; nothing needed to be retained. Commitlog position was ReplayPosition(segmentId=1402469922169, position=27138996)
INFO [ScheduledTasks:1] 2014-06-11 14:18:13,758 GCInspector.java (line 116) GC for ParNew: 640 ms for 3 collections, 775214160 used; max is 1052770304
INFO [ScheduledTasks:1] 2014-06-11 14:18:16,155 GCInspector.java (line 116) GC for ConcurrentMarkSweep: 1838 ms for 2 collections, 810976000 used; max is 1052770304
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,959 GCInspector.java (line 116) GC for ConcurrentMarkSweep: 1612 ms for 1 collections, 858404088 used; max is 1052770304
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,959 StatusLogger.java (line 55) Pool Name Active
Pending Completed Blocked All Time Blocked
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,959 StatusLogger.java (line 70) ReadStage 0 0 627 0 0
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,960 StatusLogger.java (line 70) RequestResponseStage 0
0 0 0 0
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,960 StatusLogger.java (line 70) ReadRepairStage 0 0 0 0 0
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,960 StatusLogger.java (line 70) MutationStage 0
0 184386 0 0
INFO [ScheduledTasks:1] 2014-06-11 14:18:17,960 StatusLogger.java (line 70) ReplicateOnWriteStage 0 0 0 0 0
最佳答案
这是客户端超时(参见@Syrial 回复中的链接:http://datastax.github.io/python-driver/api/cassandra.html#cassandra.OperationTimedOut)
您可以更改 session
default timeout :
session = cluster.connect()
session.default_timeout = 30 # this is in *seconds*
您可以更改 the timeout for a particular query :
session.execute(statement, 30, ...)
您可以通过在 BATCH
中使用准备好的语句来大大加快执行速度。查看Batching statements sections in this post
如果您追求更好的结果,请阅读这些 performance notes
关于python - cassandra-driver 执行查询时,cassandra-driver 返回错误 OperationTimedOut,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24157534/
我正在尝试获取此亚马逊页面中列出的每台笔记本电脑的图像 URL ( https://www.amazon.com/s?rh=n%3A565108%2Cp_72%3A4-&pf_rd_i=565108&
我正在设置 Atlassian Confluence,在选择数据库时,我在选择“使用外部 Mysql 数据库”时卡住了我看过一些教程,但对我来说,它并没有按照应有的方式工作。我使用 ubuntu 12
我是 Neo4J 的新手,正在尝试通过 java 连接到 Neo4J 服务器。 我的一个独立项目的pom入口如下: org.neo4j neo4j-o
所有这些有什么区别和用途? spark.local.ip spark.driver.host spark.driver.bind地址 spark.driver.hostname 如何将机器修复为 Sp
我在旧的 Inspiron 6400 计算机(GeForce 7300 笔记本电脑版)上安装了 Lubuntu 19.04,通过网络草稿编辑器教我儿子 Scratch。每次我通过 Firefox 打开
我使用 qt 开发了一个 c++ 库。在本文中,我使用 QSqlDatabase 从 SQLite 数据库中查询信息。注意:我的库在 qt 桌面应用程序中运行良好(我在 Linux 上开发)。 现在我
存在类似的问题,但没有帮助。 在 Apache 2.4 上安装 php5-fpm 通过 SSL 连接到远程 MySql 数据库。 可以通过命令行连接MySQL mysql -u myname -p'p
使用以下配置 (doctrine.yaml) 在 Symfony 4 中使用 Doctrine DBAL: dbal: # configure these for your database
使用以下配置 (doctrine.yaml) 在 Symfony 4 中使用 Doctrine DBAL: dbal: # configure these for your database
我有一个用 Java 编写的 Selenium Web 驱动程序测试,目标是 Liferay 站点。 // Login driver.get(baseUrl + "/"); driver.findEl
在driver.findElements()中,我们获得了另一个用于查找size()的函数,该函数在driver.findElement()中不可用。 这是唯一的区别吗? 最佳答案 driver.fi
这个问题已经有答案了: java.lang.IllegalStateException: The driver executable does not exist: while trying to e
简短描述:我有一个通过 SignTool 验证的签名驱动程序,但 Windows 拒绝加载它并出现错误:CodeIntegrity 3004 - 在系统上找不到文件哈希。我该如何解决这个问题? 详细说
我正在设置一些 Geb 测试,但出现“geb.driver.DriverCreationException:无法从回调创建驱动程序”错误。 Geb 将尝试启动测试浏览器窗口,但一旦启动,我的所有测试都
我想通过应用对象存储库概念在 Chrome 驱动程序中打开 url。下面给出的是我的 selenium 程序,其中包含两个文件,一个是 testng 文件,另一个是 config.property 文
我在 Ubuntu Linux、Spring Tools 2.7.1、Spring Roo 1.1.5 上运行 Eclipse Indigo。我正在阅读 Getting Started with Ro
打开 Url 的首选方法是什么(它们之间是否存在任何差异): driver.Url = "http://example.com"; 或 driver.Navigate().GoToUrl("http:
我使用 python 脚本传递给 cassandra 批处理查询,如下所示: query = 'BEGIN BATCH ' + 'insert into ... ; insert into ... ;
我在 Protractor 中执行脚本时出现以下错误。 System info: host: '8888', ip: '88888', os.name: 'Mac OS X', os.arch: 'x
我收到错误 KeyError:'driver'。 我想使用scrapy-selenium 创建一个网络爬虫。我的代码如下所示: class TestSpider(Spider): name="test
我是一名优秀的程序员,十分优秀!