为什么Cassandra的复制因子未设置为Elassandra中的Elasticsearch配置?

时间:2018-06-18 10:59:26

标签: elasticsearch cassandra elassandra

我正在使用 Elassandra 5.5.0.4

我使用Elassandra提供的工具Keyspace在Cassandra中创建了cqlsh,复制因子为2.

之后,我通过ElasticSearch的{​​{3}}在Elasticsearch中拥有 Discovered 键空间。

根据Bidirectional Mapping我想在Elasticsearch中找到相同的“number_of_replicas”,我在Cassandra的replication_factor中找到相同的密钥空间,但它们是不同的。

这里有一些信息:

cqlsh> desc mykeyspace;

CREATE KEYSPACE mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '2'}  AND durable_writes = true;

CREATE TABLE mykeyspace.mytable (
    url text,
    event_datetime timestamp,   
    id_domain int,
    PRIMARY KEY (url, event_datetime)
) WITH CLUSTERING ORDER BY (event_datetime DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 10000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX elastic_mytable_idx ON mykeyspace.mytable () USING 'org.elassandra.index.ExtendedElasticSecondaryIndex';

GET mykeyspace
{
  "mykeyspace": {
    "aliases": {},
    "mappings": {
      "mytable": {
        "properties": {
          "event_datetime": {
            "type": "date",
            "cql_collection": "singleton",
            "cql_primary_key_order": 1
          },         
          "id_domain": {
            "type": "integer",
            "cql_collection": "singleton"
          },
          "url": {
            "type": "keyword",
            "cql_collection": "singleton",
            "cql_partition_key": true,
            "cql_primary_key_order": 0
          }
        }
      }
    },
    "settings": {
      "index": {
        "keyspace": "mykeyspace",
        "number_of_shards": "3",
        "provided_name": "mykeyspace",
        "creation_date": "1529314140912",
        "number_of_replicas": "0",
        "uuid": "MU0kb5Y6R8KCEq_RI2clBQ",
        "version": {
          "created": "5050099"
        }
      }
    }
  }
}

为什么我在Cassandra和ElasticSearch中看不到相同的复制因子?我在弹性搜索的索引创建过程中是否犯了一些错误?

由于

0 个答案:

没有答案