将 cassandra-stress 连接到 AWS Keyspaces

问题描述 投票:0回答:2

我在 AWS 上配置了一个 Keyspace,为了确保它能够达到我们想要的性能,我尝试在它上面运行

cassandra-stress
工具,并将它与我们正在试验的其他架构进行比较。

我设法使用以下

cqlshrc
连接到它:

[connection]
port = 9142
factory = cqlshlib.ssl.ssl_transport_factory

[ssl]
validate = true
certfile =  /root/.cassandra/AmazonRootCA1.pem

以及以下命令(希望很快就会有 Python3 支持,根据他们的Jira ticket,开发已于今年 2 月完成):

cqlsh cassandra.eu-central-1.amazonaws.com 9142  -u "myuser-at-722222222222" -p "12/12ZmHmtD1klsDk9cgqt/XXXXXXXXxUz6Sy687z/U=" --ssl --cqlversion="3.4.4"

令人惊讶与否,当使用官方 AWS 指南时,事情往往会起作用。

所以我继续尝试将

cassandra-stress
工具(我把它放在一个 Docker 容器中,我宁愿让我的操作系统 Java 免费)连接到同一个键空间。

首先,我使用以下命令将 AWS

AmazonRootCA1.pem
转换为
cassandra_truststore.jks
(在 here 中解释):

openssl x509 -outform der -in AmazonRootCA1.pem -out temp_file.der
keytool -import -alias cassandra -keystore cassandra_truststore.jks -file temp_file.der

现在,当我尝试像这样运行实际工具时:

./cassandra-stress write -node cassandra.eu-central-1.amazonaws.com -port native=9142 thrift=9142 jmx=9142 -transport truststore=/root/.cassandra/cassandra_truststore.jks truststore-password=mypassword -mode native cql3 user="myuser-at-722222222222" password="12/12ZmHmtD1klsDk9cgqt/XXXXXXXXxUz6Sy687z/U="

我收到以下错误:

******************** Stress Settings ********************
Command:
  Type: write
  Count: -1
  No Warmup: false
  Consistency Level: LOCAL_ONE
  Target Uncertainty: 0.020
  Minimum Uncertainty Measurements: 30
  Maximum Uncertainty Measurements: 200
  Key Size (bytes): 10
  Counter Increment Distibution: add=fixed(1)
Rate:
  Auto: true
  Min Threads: 4
  Max Threads: 1000
Population:
  Sequence: 1..1000000
  Order: ARBITRARY
  Wrap: true
Insert:
  Revisits: Uniform:  min=1,max=1000000
  Visits: Fixed:  key=1
  Row Population Ratio: Ratio: divisor=1.000000;delegate=Fixed:  key=1
  Batch Type: not batching
Columns:
  Max Columns Per Key: 5
  Column Names: [C0, C1, C2, C3, C4]
  Comparator: AsciiType
  Timestamp: null
  Variable Column Count: false
  Slice: false
  Size Distribution: Fixed:  key=34
  Count Distribution: Fixed:  key=5
Errors:
  Ignore: false
  Tries: 10
Log:
  No Summary: false
  No Settings: false
  File: null
  Interval Millis: 1000
  Level: NORMAL
Mode:
  API: JAVA_DRIVER_NATIVE
  Connection Style: CQL_PREPARED
  CQL Version: CQL3
  Protocol Version: V4
  Username: myuser-at-722222222222
  Password: *suppressed*
  Auth Provide Class: null
  Max Pending Per Connection: 128
  Connections Per Host: 8
  Compression: NONE
Node:
  Nodes: [cassandra.eu-central-1.amazonaws.com]
  Is White List: false
  Datacenter: null
Schema:
  Keyspace: keyspace1
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Replication Strategy Pptions: {replication_factor=1}
  Table Compression: null
  Table Compaction Strategy: null
  Table Compaction Strategy Options: {}
Transport:
  factory=org.apache.cassandra.thrift.TFramedTransportFactory; truststore=/root/.cassandra/cassandra_truststore.jks; truststore-password=mypassword; keystore=null; keystore-password=null; ssl-protocol=TLS; ssl-alg=SunX509; store-type=JKS; ssl-ciphers=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA; 
Port:
  Native Port: 9142
  Thrift Port: 9142
  JMX Port: 9142
Send To Daemon:
  *not set*
Graph:
  File: null
  Revision: unknown
  Title: null
  Operation: WRITE
TokenRange:
  Wrap: false
  Split Factor: 1

java.lang.RuntimeException: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: cassandra.eu-central-1.amazonaws.com/3.127.48.183:9142 (com.datastax.driver.core.exceptions.TransportException: [cassandra.eu-central-1.amazonaws.com/3.127.48.183] Channel has been closed))
        at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:220)
        at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpacesNative(SettingsSchema.java:79)
        at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpaces(SettingsSchema.java:69)
        at org.apache.cassandra.stress.settings.StressSettings.maybeCreateKeyspaces(StressSettings.java:228)
        at org.apache.cassandra.stress.StressAction.run(StressAction.java:57)
        at org.apache.cassandra.stress.Stress.run(Stress.java:143)
        at org.apache.cassandra.stress.Stress.main(Stress.java:62)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: cassandra.eu-central-1.amazonaws.com/3.127.48.183:9142 (com.datastax.driver.core.exceptions.TransportException: [cassandra.eu-central-1.amazonaws.com/3.127.48.183] Channel has been closed))
        at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:233)
        at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
        at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1424)
        at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:403)
        at org.apache.cassandra.stress.util.JavaDriverClient.connect(JavaDriverClient.java:160)
        at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:211)
        ... 6 more

我试过更改一些参数,例如

jks
密码等(以防万一我错了)但我收到了不同的错误消息,所以可能不是这样。

我错过了什么吗?

amazon-web-services ssl cassandra stress-testing amazon-keyspaces
2个回答
2
投票

尝试使用 TLP 压力代替。

tlp-stress run RandomPartitionAccess -d 10m --host cassandra.us-east-1.amazonaws.com --port 9142 --username alice --password fLyWYFlTCD5J2gzGAZ –ssl --max-requests 4000 --dc us-east-2 --threads 10

https://thelastpickle.com/tlp-stress/


1
投票

cassandra-stress 的默认策略是 SimpleStragey,如您的输出所示。

架构:键空间:keyspace1

复制策略:org.apache.cassandra.locator.SimpleStrategy 复制策略选项:{replication_factor=1}

您可能需要将其更改为 Keyspaces SingleRegionStrategy:

ALTER KEYSPACE keyspace1 WITH REPLICATION = {'class': 'SingleRegionStrategy'};
© www.soinside.com 2019 - 2024. All rights reserved.