我已經在DC上創建了一個密鑰空間。在同一個DC上的兩個Keyspace
爲tradebees_dev密鑰空間創建查詢: - (這個密鑰空間是工作的罰款。)
CREATE KEYSPACE tradebees_dev WITH replication = {'class': 'NetworkTopologyStrategy', 'solr': '3'} AND durable_writes = true;
狀態低於: -
nodetool status tradebees_dev
Datacenter: Solr
================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 1.09 GB 256 100.0% e754d239-8370-4e1d-82c8-dce3d401f972 rack1
UN 127.0.0.2 1.19 GB 256 100.0% 70b74025-1881-4756-a0c8-a1ec5e57d407 rack1
UN 127.0.0.3 1.53 GB 256 100.0% 3ba4bfe4-c894-4cd1-a684-f0f20edac78f rack1
那之後,我創造了另一個密鑰空間上相同的DC具有相同的複製因素。
創建crawl_dev密鑰空間查詢: -
CREATE KEYSPACE crawl_dev WITH replication = {'class': 'NetworkTopologyStrategy', 'solr': '3'} AND durable_writes = true;
nodetool status crawl_dev
Datacenter: Solr
================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 1.09 GB 256 0.0% e754d239-8370-4e1d-82c8-dce3d401f972 rack1
UN 127.0.0.2 1.19 GB 256 0.0% 70b74025-1881-4756-a0c8-a1ec5e57d407 rack1
UN 127.0.0.3 1.53 GB 256 0.0% 3ba4bfe4-c894-4cd1-a684-f0f20edac78f rack1
作爲第一密鑰空間工作正常,但是當我試圖做的crawl_dev第二密鑰空間即選擇查詢,我收到以下錯誤消息。
Traceback (most recent call last):
File "/usr/share/dse/resources/cassandra/bin/cqlsh", line 1124, in perform_simple_statement
rows = self.session.execute(statement, trace=self.tracing_enabled)
File "/usr/share/dse/resources/cassandra/bin/../lib/cassandra-driver-internal-only-2.7.2-5d33cb4.zip/cassandra-driver-2.7.2-5d33cb4/cassandra/cluster.py", line 1602, in execute
result = future.result()
File "/usr/share/dse/resources/cassandra/bin/../lib/cassandra-driver-internal-only-2.7.2-5d33cb4.zip/cassandra-driver-2.7.2-5d33cb4/cassandra/cluster.py", line 3347, in result
raise self._final_exception
Unavailable: code=1000 [Unavailable exception] message="Cannot achieve consistency level ONE" info={'required_replicas': 1, 'alive_replicas': 0, 'consistency': 'ONE'}
請教我如何解決這個問題。也讓我知道我們可以在同一個DC上創建兩個密鑰空間。是或否。
經過一番研究,我得到信息,然後我在這個文件中,DC = DC1和RC檢查
/etc/dse/cassandra/cassandra-rackdc.properties
= RACK1給出。 謝謝。
它是否發生在所有的鍵空間表上? –