cqlsh

SSL options in gocql

萝らか妹 提交于 2021-02-08 05:16:04
问题 In my Cassandra config I have enabled user authentication and connect with cqlsh over ssl. I'm having trouble implementing the same with gocql, following is my code: cluster := gocql.NewCluster("127.0.0.1") cluster.Authenticator = gocql.PasswordAuthenticator{ Username: "myuser", Password: "mypassword", } cluster.SslOpts = &gocql.SslOptions { CertPath: "/path/to/cert.pem", } When I try to connect I get following error: gocql: unable to create session: connectionpool: unable to load X509 key

what are cqlsh tracing entries meaning?

不打扰是莪最后的温柔 提交于 2021-02-07 19:14:16
问题 activity | timestamp | source | source_elapsed ------------------------------------------------------------------------------------------------------+--------------+---------------+---------------- execute_cql3_query | 06:30:52,479 | 192.168.11.23 | 0 Parsing select adid from userlastadevents where userid = '90000012' and type in (1,2,3) LIMIT 10000; | 06:30:52,479 | 192.168.11.23 | 44 Peparing statement | 06:30:52,479 | 192.168.11.23 | 146 Executing single-partition query on userlastadevents

Check CQL version with Cassandra and cqlsh?

独自空忆成欢 提交于 2021-02-05 20:47:39
问题 How do you check which cql version is currently being used in cqlsh? In sql, you do this: Select @@version 回答1: There are a couple of ways to go about this. From within cqlsh, you can simply show version . aploetz@cqlsh> show version [cqlsh 5.0.1 | Cassandra 2.1.8 | CQL spec 3.2.0 | Native protocol v3] However, that only works from within cqlsh. Fortunately, you can also query system.local for that information as well. aploetz@cqlsh> SELECT cql_version FROM system.local; cql_version ---------

Delete records in Cassandra table based on time range

随声附和 提交于 2021-02-05 06:49:46
问题 I have a Cassandra table with schema: CREATE TABLE IF NOT EXISTS TestTable( documentId text, sequenceNo bigint, messageData blob, clientId text PRIMARY KEY(documentId, sequenceNo)) WITH CLUSTERING ORDER BY(sequenceNo DESC); Is there a way to delete the records which were inserted between a given time range? I know internally Cassandra must be using some timestamp to track the insertion time of each record, which would be used by features like TTL. Since there is no explicit column for

NoHostAvailable error in cqlsh console

青春壹個敷衍的年華 提交于 2021-01-22 08:02:14
问题 I was able to get rid of this error later but i am not sure what i did is correct. 1 ) CREATE KEYSPACE myKeySpace WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '2'} AND durable_writes = true; Execute create table and select table after this. This throws "NoHostAvailable:" error in the console. 2 ) If I change the create statement to the below one, the select query works. CREATE KEYSPACE myKeySpace WITH replication = {'class': 'NetworkTopologyStrategy',

NoHostAvailable error in cqlsh console

巧了我就是萌 提交于 2021-01-22 08:00:57
问题 I was able to get rid of this error later but i am not sure what i did is correct. 1 ) CREATE KEYSPACE myKeySpace WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '2'} AND durable_writes = true; Execute create table and select table after this. This throws "NoHostAvailable:" error in the console. 2 ) If I change the create statement to the below one, the select query works. CREATE KEYSPACE myKeySpace WITH replication = {'class': 'NetworkTopologyStrategy',

Creating new table with cqlsh on existing keyspace: Column family ID mismatch

跟風遠走 提交于 2020-11-30 06:20:31
问题 Houston, we have a problem. Trying to create a new table with cqlsh on an existing Cassandra (v2.1.3) keyspace results in: ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found e8c03790-c952-11e4-a753-5981ea73cd7c; expected e8b14370-c952-11e4-a844-8f10bfb9c386)"> After the first create attempt, trying

Kubernetes - connect to cassandra from job to different pod

ぐ巨炮叔叔 提交于 2020-08-25 07:26:49
问题 When I'm trying to execute the following command ["/bin/sh", "-c", "cqlsh cassandra.my-namespace.svc.cluster.local -f /path/to/schema.cql"] from my Job, I am receiving the following error: Traceback (most recent call last): File "/usr/bin/cqlsh.py", line 2443, in <module> main(*read_options(sys.argv[1:], os.environ)) File "/usr/bin/cqlsh.py", line 2421, in main encoding=options.encoding) File "/usr/bin/cqlsh.py", line 485, in __init__ load_balancing_policy=WhiteListRoundRobinPolicy([self

Kubernetes - connect to cassandra from job to different pod

淺唱寂寞╮ 提交于 2020-08-25 07:24:23
问题 When I'm trying to execute the following command ["/bin/sh", "-c", "cqlsh cassandra.my-namespace.svc.cluster.local -f /path/to/schema.cql"] from my Job, I am receiving the following error: Traceback (most recent call last): File "/usr/bin/cqlsh.py", line 2443, in <module> main(*read_options(sys.argv[1:], os.environ)) File "/usr/bin/cqlsh.py", line 2421, in main encoding=options.encoding) File "/usr/bin/cqlsh.py", line 485, in __init__ load_balancing_policy=WhiteListRoundRobinPolicy([self

Executing CQL through Shell Script?

梦想与她 提交于 2020-08-03 12:55:10
问题 I am trying to execute the CQL commands from shell script. I am able to connect to the cqlsh (CQL version i'm using is 1.1.18) but unable to send the queries to cql. Any ideas or suggestion how to proceed on this? Do I need to connect to Cassandra and execute few commands (select/update ) with shell script ?? 回答1: cqlsh -e "select * from ks.table limit 1;" > ~/output 回答2: I'm not sure about Cassandra 1.1.18, but you should be able to accomplish this with the -f flag of cqlsh . Let's say have