OperationTimedOut: errors = {}, last_host = 127.0.0.1

I use a single Cassandra node, and I intend to run some queries to check the response time. In some queries, after 10 seconds of execution, the following error occurs:

OperationTimedOut: errors = {}, last_host = 127.0.0.1 

So, I executed the following command:

 sudo gedit /usr/bin/cqlsh.py 

And changed the cqlsh.py file:

 # cqlsh should run correctly when run out of a Cassandra source tree, # out of an unpacked Cassandra tarball, and after a proper package install. cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib') if os.path.isdir(cqlshlibdir): sys.path.insert(0, cqlshlibdir) from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling from cqlshlib.displaying import (ANSI_RESET, BLUE, COLUMN_NAME_COLORS, CYAN, RED, FormattedValue, colorme) from cqlshlib.formatting import (DEFAULT_DATE_FORMAT, DEFAULT_NANOTIME_FORMAT, DEFAULT_TIMESTAMP_FORMAT, DateTimeFormat, format_by_type, format_value_utype, formatter_for) from cqlshlib.tracing import print_trace, print_trace_session from cqlshlib.util import get_file_encoding_bomsize, trim_if_present DEFAULT_HOST = '127.0.0.1' DEFAULT_PORT = 9042 DEFAULT_CQLVER = '3.3.1' DEFAULT_PROTOCOL_VERSION = 4 DEFAULT_CONNECT_TIMEOUT_SECONDS = 240 DEFAULT_FLOAT_PRECISION = 5 DEFAULT_MAX_TRACE_WAIT = 300 

However, when I try to run the query again, cql returns the same error after 10 seconds:

 OperationTimedOut: errors = {}, last_host = 127.0.0.1 

What do I need to do so that the request does not have a response timeout?

+5
source share
4 answers

Do you execute these queries in cqlsh?

If so, you click on the client request timeout (and not on the connection timeout, as well as on the server side read request timeout).

You can change the default timeout by setting it to ~ / .cassandra / cqlshrc:

 [connection] client_timeout = 20 # Can also be set to None to disable: # client_timeout = None 

See https://issues.apache.org/jira/browse/CASSANDRA-7516 for more details.

I see from another comment that you already know about paging. This will be the best approach because it does not require you to marshal the entire set of results in memory at the data and application levels.

+5
source

The latest version of cassandra allows you to specify the cqlsh timeout when you use it, instead of editing the cqlshrc file.

cqlsh --request-timeout <your-timeout>

+6
source

You will see several answers telling you how to raise different timeouts, but the real answer is that you almost never want to raise these timeouts, because if you have a real dataset, you will kill your server (or drop requests / mutations) with a lot of long queries. You are better off using swap and shorter queries than huge, long queries.

+4
source

You must change the read_request_timeout_in_ms parameter in the read_request_timeout_in_ms file. And then restart Cassandra.

+1
source

Source: https://habr.com/ru/post/1234385/


All Articles