Cassandra'nın sıkıştırma stratejisini değiştirme

Apigee; proxy, önbellek ve jeton verileri de dahil olmak üzere verilerinin çoğunu saklamak için Cassandra veritabanlarını kullanır. Sıkıştırma, veritabanlarında depolanan verilerin boyutunu azaltmak için kullanılan standart bir işlemdir. Bu işlem, veritabanlarının verimli şekilde çalışmasını sağlamak için son derece önemlidir. Cassandra, sıkıştırma için çeşitli stratejileri destekler. Apigee, tüm Private Cloud müşterilerinin Cassandra kümelerini tüm sütun aileleri için varsayılan strateji SizeTieredCompactionStrategy yerine LeveledCompactionStrategy stratejisiyle çalıştırmasını önerir. LeveledCompactionStrategy, SizedTieredCompactionStrategy ile kıyaslandığında daha iyi performans, daha iyi disk kullanımı ve daha verimli sıkıştırmanın yanı sıra daha az boş alan gerektirir.

Apigee 4.51.00 veya üzeri tüm yeni kurulumlarda Cassandra otomatik olarak LeveledCompactionStrategy ile kurulur. Ancak Apigee'nin eski bir sürümünü kullanıyorsanız veya eski bir sürümden Apigee 4.51.00 sürümüne yükselttiyseniz sürümünüzde SizeTieredCompactionStrategy ile Cassandra kullanılmaya devam ediyor olabilir. Cassandra sürümünüzün hangi sıkıştırma stratejisini kullandığını öğrenmek için Sıkıştırma stratejisini kontrol etme bölümüne bakın.

Bu sayfada, sıkıştırma stratejisinin nasıl LeveledCompactionStrategy olarak değiştirileceği açıklanmaktadır.

Hazırlık

Mevcut sıkıştırma stratejisini kontrol edin

Sütun ailelerindeki mevcut sıkıştırma stratejisini kontrol etmek için Sıkıştırma stratejisini kontrol etme bölümündeki talimatları uygulayın. Sıkıştırma stratejisi zaten LeveledCompactionStrategy ise bu sayfadaki diğer talimatları uygulamanız gerekmez.

Yedekleme

Sıkıştırma stratejisinin değiştirilmesi C* düğümlerinde tam bir sıkıştırma döngüsünü tetiklediğinden, sıkıştırma yükü ve eş zamanlı uygulama trafiği nedeniyle gecikmeler yaşanabilir. Cassandra düğümlerini yedeklerden geri yüklemek için bu değişikliğin geri alınması gerekebilir. Sıkıştırma stratejisini değiştirmeden önce verilerinizi nasıl yedekleyeceğinizi öğrenmek için Yedekleme bölümüne bakın.

Sıkıştırma işleme hızı

Sıkıştırma stratejisi LeveledCompactionStrategy olarak değiştirildikten sonra sıkıştırmalar uzun süre çalışabilir. Veri sıkıştırmanın boyutuna bağlı olarak çalışma zamanı değişiklik gösterebilir. Cassandra, sıkıştırma döngüsü sırasında daha fazla sistem kaynağı kullanabilir. Sıkıştırma işleminin çok fazla sistem kaynağı kaplamasını ve bunun da API Çalışma Zamanı isteklerini kesintiye uğratmasını önlemek amacıyla sıkıştırma işleme hızı için sınırlar belirlemenizi öneririz.

Sıkıştırma işleme hızını tüm C* düğümlerinde en fazla 128 MB olacak şekilde ayarlamak için her düğümde aşağıdaki nodetool komutunu çalıştırın:

nodetool setcompactionthroughput 128

Sanal makineleri sıkıştırma için boyutlandırma

Bu değişikliği yürütmeden önce C* düğümlerinde yeterli CPU/Bellek kaynağına sahip olduğundan emin olun. Bu değişikliği yürütmeden önce hiçbir C* düğümünün CPU yükünün% 25'inden fazlasında çalışmadığından emin olun.

Sıkıştırma stratejisi değiştikten sonra, tam bir sıkıştırma döngüsünün çalışması beklenir. Bu nedenle, sıkıştırma stratejisinin düşük trafik dönemlerinde değiştirilmesi önerilir.

Aşamalı çalıştırmalar

Dizinlerin her düğümde tek tek yeniden oluşturulması gerektiğinden, özellikle büyük Cassandra kümeleri yönetiyorsanız tüm düğümlerdeki değişiklikleri bir gün içinde tamamlayamayabilirsiniz. Her defasında bir şemanın veya bir sütun ailesinin (tablo) sıkıştırma stratejisini değiştirebilirsiniz. Bunun için sütun ailesini değiştirerek sıkıştırma stratejisini değiştirin ve ardından tablodaki tüm dizinleri (varsa) tüm düğümlerde yeniden oluşturun. Sonra yukarıdaki prosedürü her tablo veya tuş alanı için tekrarlayın. Bir tablo veya bir anahtar alanı için bu tür çalıştırmalar, farklı günlerde çalışacak şekilde ayrılabilir.

Örneğin, kms şemasında oauth_20_access_tokens sütun ailesinin sıkıştırma stratejisini değiştirmek için aşağıdakileri yapabilirsiniz:

  1. Sıkıştırma stratejisini değiştirmek için tabloyu değiştirin:
       
    ALTER TABLE kms.oauth_20_access_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  2. Yalnızca bu tablonun tüm dizinlerini yeniden oluştur:
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_app_id_idx
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_client_id_idx
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_refresh_token_idx

Sıkıştırma stratejisini değiştirme

Genel anlamda, sıkıştırma stratejisini değiştirmek 2 adımlı bir işlemdir:

  1. Her tablonun sıkıştırma stratejisini değiştirin.
  2. Her düğümdeki tüm dizinleri tek tek yeniden oluşturun.

Yeni sıkıştırma stratejisi belirlemek için Tabloyu Değiştir

Aşağıdaki Cassandra Sorgu Dili (CQL) komutlarını herhangi bir Cassandra düğümünde çalıştırın ve her defasında tek bir anahtar alanı için stratejiyi değiştirin. CQL can'ı cql isteminde çalıştırabilirsiniz. cql istemini çağırmak için:

/opt/apigee/apigee-cassandra/bin/cqlsh `hostname -i`

Şuna benzer bir yanıt görürsünüz:

Connected to apigee at XX.XX.XX.XX:9042.
[cqlsh 5.0.1 | Cassandra 2.1.16 | CQL spec 3.2.1 | Native
protocol v3]
Use HELP for help.
cqlsh>

Sıkıştırma stratejisini değiştirmek için aşağıdaki CQL'leri çalıştırın:

  • kms tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE kms.organizations WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.maps WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.apps WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.app_credentials WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.api_products WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.apiproducts_appslist WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.api_resources WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.app_end_user WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.oauth_20_authorization_codes WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.oauth_20_access_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.oauth_10_request_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.oauth_10_access_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.oauth_10_verifiers WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE kms.app_enduser_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • user_settings tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE user_settings.user_settings WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • keyvaluemap tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
       
    ALTER TABLE keyvaluemap.keyvaluemaps_r21 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • devconnect anahtar alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
        
    ALTER TABLE devconnect.developers WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE devconnect.companies WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE devconnect.company_developers WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • counter tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE counter.counters_current_version WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.counters_with_expiry WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.counters WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.key_timestamp_count WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.timestamp_key WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.period_timestamp WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE counter.gateway_quota WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • cache tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE cache.cache_entries WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE cache.cache_sequence_id_r24 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • ax_custom_report_model tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE ax_custom_report_model.report_description WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_id_lookup WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.org_metadata WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.org_report_lookup WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_created_view WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_viewed_view WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • auth tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE auth.totp WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • audit tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE audit.audits WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE audit.audits_ref WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • apprepo tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE apprepo.organizations WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apprepo.environments WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apprepo.apiproxies WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apprepo.apiproxy_revisions WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apprepo.api_proxy_revisions_r21 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • apimodel tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE apimodel.apis WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.apis_revision WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.resource WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.method WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.revision_counters WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.template_counters WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.template WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.credentials WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.credentialsv2 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.schemas WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.security WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE apimodel.template_auth WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • identityzone tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE identityzone.IdentityZones WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE identityzone.OrgToIdentityZone WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • dek tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE dek.keys WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • analytics tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE analytics.custom_aggregates_defn WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE analytics.custom_rules_defn WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE analytics.custom_aggregates_defn_updates WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE analytics.custom_rules_defn_updates WITH compaction = {'class' : 'LeveledCompactionStrategy'};

Dizinleri yeniden oluştur

Bu adımı sıkıştırma stratejisi değiştikten sonra yürütmeniz gerekir. Aşağıdaki nodetool komutlarını her Cassandra düğümünde art arda çalıştırın.

Dizinleri yeniden oluşturmak için aşağıdaki nodetool komutlarını çalıştırın:

  • kms anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index kms maps maps_organization_name_idx
    nodetool rebuild_index kms apps apps_app_family_idx
    nodetool rebuild_index kms apps apps_app_id_idx
    nodetool rebuild_index kms apps apps_app_type_idx
    nodetool rebuild_index kms apps apps_name_idx
    nodetool rebuild_index kms apps apps_organization_name_idx
    nodetool rebuild_index kms apps apps_parent_id_idx
    nodetool rebuild_index kms apps apps_parent_status_idx
    nodetool rebuild_index kms apps apps_status_idx
    nodetool rebuild_index kms app_credentials app_credentials_api_products_idx
    nodetool rebuild_index kms app_credentials app_credentials_organization_app_id_idx
    nodetool rebuild_index kms app_credentials app_credentials_organization_name_idx
    nodetool rebuild_index kms api_products api_products_organization_name_idx
    nodetool rebuild_index kms app_end_user app_end_user_app_id_idx
    nodetool rebuild_index kms oauth_20_authorization_codes oauth_20_authorization_codes_client_id_idx
    nodetool rebuild_index kms oauth_20_authorization_codes oauth_20_authorization_codes_organization_name_idx
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_app_id_idx
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_client_id_idx
    nodetool rebuild_index kms oauth_20_access_tokens oauth_20_access_tokens_refresh_token_idx
    nodetool rebuild_index kms oauth_10_request_tokens oauth_10_request_tokens_consumer_key_idx
    nodetool rebuild_index kms oauth_10_request_tokens oauth_10_request_tokens_organization_name_idx
    nodetool rebuild_index kms oauth_10_access_tokens oauth_10_access_tokens_app_id_idx
    nodetool rebuild_index kms oauth_10_access_tokens oauth_10_access_tokens_consumer_key_idx
    nodetool rebuild_index kms oauth_10_access_tokens oauth_10_access_tokens_organization_name_idx
    nodetool rebuild_index kms oauth_10_access_tokens oauth_10_access_tokens_status_idx
    nodetool rebuild_index kms oauth_10_verifiers oauth_10_verifiers_organization_name_idx
    nodetool rebuild_index kms oauth_10_verifiers oauth_10_verifiers_request_token_idx
  • devconnect anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index devconnect companies companies_name_idx
    nodetool rebuild_index devconnect companies companies_organization_name_idx
    nodetool rebuild_index devconnect companies companies_status_idx
    nodetool rebuild_index devconnect company_developers company_developers_company_name_idx
    nodetool rebuild_index devconnect company_developers company_developers_developer_email_idx
    nodetool rebuild_index devconnect company_developers company_developers_organization_name_idx
    nodetool rebuild_index devconnect developers developers_email_idx
    nodetool rebuild_index devconnect developers developers_organization_name_idx
    nodetool rebuild_index devconnect developers developers_status_idx
  • cache anahtar alanı için dizinleri yeniden oluştur:
        
    nodetool rebuild_index cache cache_entries cache_entries_cache_name_idx
  • audit anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index audit audits audits_operation_idx
    nodetool rebuild_index audit audits audits_requesturi_idx
    nodetool rebuild_index audit audits audits_responsecode_idx
    nodetool rebuild_index audit audits audits_timestamp_idx
    nodetool rebuild_index audit audits audits_user_idx
  • apprepo anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index apprepo environments environments_organization_name_idx
  • apimodel anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index apimodel apis a_name
    nodetool rebuild_index apimodel apis a_org_name
    nodetool rebuild_index apimodel apis_revision ar_a_name
    nodetool rebuild_index apimodel apis_revision ar_a_uuid
    nodetool rebuild_index apimodel apis_revision ar_base_url
    nodetool rebuild_index apimodel apis_revision ar_is_active
    nodetool rebuild_index apimodel apis_revision ar_is_latest
    nodetool rebuild_index apimodel apis_revision ar_org_name
    nodetool rebuild_index apimodel apis_revision ar_rel_ver
    nodetool rebuild_index apimodel apis_revision ar_rev_num
    nodetool rebuild_index apimodel resource r_a_name
    nodetool rebuild_index apimodel resource r_api_uuid
    nodetool rebuild_index apimodel resource r_ar_uuid
    nodetool rebuild_index apimodel resource r_base_url
    nodetool rebuild_index apimodel resource r_name
    nodetool rebuild_index apimodel resource r_org_name
    nodetool rebuild_index apimodel resource r_res_path
    nodetool rebuild_index apimodel resource r_rev_num
    nodetool rebuild_index apimodel method m_a_name
    nodetool rebuild_index apimodel method m_api_uuid
    nodetool rebuild_index apimodel method m_ar_uuid
    nodetool rebuild_index apimodel method m_base_url
    nodetool rebuild_index apimodel method m_name
    nodetool rebuild_index apimodel method m_org_name
    nodetool rebuild_index apimodel method m_r_name
    nodetool rebuild_index apimodel method m_r_uuid
    nodetool rebuild_index apimodel method m_res_path
    nodetool rebuild_index apimodel method m_rev_num
    nodetool rebuild_index apimodel method m_verb
    nodetool rebuild_index apimodel template t_a_name
    nodetool rebuild_index apimodel template t_a_uuid
    nodetool rebuild_index apimodel template t_entity
    nodetool rebuild_index apimodel template t_name
    nodetool rebuild_index apimodel template t_org_name
    nodetool rebuild_index apimodel schemas s_api_uuid
    nodetool rebuild_index apimodel schemas s_ar_uuid
    nodetool rebuild_index apimodel security sa_api_uuid
    nodetool rebuild_index apimodel security sa_ar_uuid
    nodetool rebuild_index apimodel template_auth au_api_uuid
  • dek anahtar alanı için dizinleri yeniden oluştur:
    nodetool rebuild_index dek keys usecase_index

Doğrulama

  1. Sıkıştırma stratejisini kontrol etme bölümündeki talimatları uygulayarak şemada sıkıştırma stratejisi değişikliğinin geçerli olup olmadığını kontrol edin.
  2. Sıkıştırma işleminin başarılı olduğunu ve strateji değişikliğinden sonra verilerin sıkıştırıldığını doğrulayın:
    1. Tüm sıkıştırma işlemlerinin tamamlanıp tamamlanmadığını ve beklemede herhangi bir şey olup olmadığını görmek için her cassandra düğümünde aşağıdaki nodetool komutunu çalıştırın:
      nodetool compactionstats
    2. Bekleyen herhangi bir sıkıştırma işlemi olmadığından emin olmak için yukarıdaki komut kullanılarak doğrulandıktan sonra veri dosyalarının son değiştirilen zaman damgasını (/opt/Apigee/data/become-cassandra/data/ altında) sıkıştırma stratejisi değişikliği CQL'nin yürütüldüğü zaman damgasından sonra olacak şekilde kontrol edin.

Geri çek

Geri dönmeniz gerekirse aşağıdaki seçeneklerden birini uygulayabilirsiniz:

1. Seçenek: Değişikliği geri alma

Sıkıştırma stratejisini SizeTieredCompactionStrategy değerine geri al.

Aşağıdaki CQL'leri, herhangi bir Cassandra düğümü değiştirme stratejisi üzerinde, aynı anda tek bir anahtar alanı için çalıştırın. CQL'leri cql isteminde çalıştırabilirsiniz. cql istemini çağırmak için:

/opt/apigee/apigee-cassandra/bin/cqlsh `hostname -i`

Şuna benzer bir yanıt görürsünüz:

Connected to apigee at XX.XX.XX.XX:9042.
[cqlsh 5.0.1 | Cassandra 2.1.16 | CQL spec 3.2.1 | Native
protocol v3]
Use HELP for help.
cqlsh>

Sıkıştırma stratejisini değiştirmek için aşağıdaki CQL'leri çalıştırın:

  • kms tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE kms.organizations WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.maps WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.apps WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.app_credentials WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.api_products WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.apiproducts_appslist WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.api_resources WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.app_end_user WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.oauth_20_authorization_codes WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.oauth_20_access_tokens WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.oauth_10_request_tokens WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.oauth_10_access_tokens WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.oauth_10_verifiers WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE kms.app_enduser_tokens WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • user_settings tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE user_settings.user_settings WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • keyvaluemap tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE keyvaluemap.keyvaluemaps_r21 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • devconnect tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE devconnect.developers WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE devconnect.companies WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE devconnect.company_developers WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • counter tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE counter.counters_current_version WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.counters_with_expiry WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.counters WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.key_timestamp_count WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.timestamp_key WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.period_timestamp WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE counter.gateway_quota WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • cache tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE cache.cache_entries WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE cache.cache_sequence_id_r24 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • ax_custom_report_model tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE ax_custom_report_model.report_description WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_id_lookup WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.org_metadata WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.org_report_lookup WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_created_view WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE ax_custom_report_model.report_viewed_view WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • auth tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE auth.totp WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • audit tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE audit.audits WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE audit.audits_ref WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • apprepo tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE apprepo.organizations WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apprepo.environments WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apprepo.apiproxies WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apprepo.apiproxy_revisions WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apprepo.api_proxy_revisions_r21 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • apimodel tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE apimodel.apis WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.apis_revision WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.resource WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.method WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.revision_counters WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.template_counters WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.template WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.credentials WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.credentialsv2 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.schemas WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.security WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE apimodel.template_auth WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • identityzone tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE identityzone.IdentityZones WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE identityzone.OrgToIdentityZone WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • dek tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
        
    ALTER TABLE dek.keys WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • analytics tuş alanı için sıkıştırma stratejisini değiştirecek CQL'ler:
    ALTER TABLE analytics.custom_aggregates_defn WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE analytics.custom_rules_defn WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE analytics.custom_aggregates_defn_updates WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE analytics.custom_rules_defn_updates WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};

Tüm sütun aileleri değiştirildikten sonra, sıkıştırma stratejisini LeveledCompactionStrategy olarak değiştirirken dizinleri yeniden oluşturduysanız dizinleri yeniden oluşturmanız gerekir. Tüm dizinleri yeniden oluşturmak için daha önceki adımların aynısını uygulayın. Dizinleri daha önce yeniden oluşturmadıysanız geri alma işlemi sırasında dizinleri yeniden oluşturmanız gerekmez.

2. Seçenek - Verileri yedekten tam geri yükleme

Verileri eksiksiz bir şekilde geri yüklemek için Yedeklemeden geri yükleme başlıklı makaledeki talimatlara bakın.

Sıkıştırma stratejisini kontrol edin

Sıkıştırma stratejileri, Cassandra'da sütun ailesi (tablo) düzeyinde ayarlanır. Her sütun ailesinin sıkıştırma stratejisini kontrol etmek için aşağıdaki CQL sorgularını kullanabilirsiniz.

CQL'leri cql isteminde çalıştırabilirsiniz. cql istemini çağırmak için:

/opt/apigee/apigee-cassandra/bin/cqlsh `hostname -i`

Şuna benzer bir yanıt görürsünüz:

Connected to apigee at XX.XX.XX.XX:9042.
[cqlsh 5.0.1 | Cassandra 2.1.16 | CQL spec 3.2.1 | Native
protocol v3]
Use HELP for help.
cqlsh>

Mevcut sıkıştırma stratejisini aşağıdaki gibi belirleyebilirsiniz:

  • Sıkıştırma stratejisi SizeTieredCompactionStrategy olarak ayarlanırsa aşağıdaki sorguların çıkışı org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy olur.
  • Sıkıştırma stratejisi LeveledCompactionStrategy olarak ayarlanırsa aşağıdaki sorguların çıkışı org.apache.cassandra.db.compaction.LeveledCompactionStrategy olur.

Sıkıştırma stratejisini doğrulamak için aşağıdaki CQL'leri çalıştırın:

  • kms anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'organizations';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'maps';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'apps';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'app_credentials';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'api_products';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'apiproducts_appslist';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'api_resources';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'app_end_user';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'oauth_20_authorization_codes';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'oauth_20_access_tokens';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'oauth_10_request_tokens';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'oauth_10_access_tokens';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'oauth_10_verifiers';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name ='kms' and columnfamily_name = 'app_enduser_tokens';
  • user_settings anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'user_settings' and columnfamily_name = 'user_settings';
  • keyvaluemap anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'keyvaluemap' and columnfamily_name = 'keyvaluemaps_r21';
  • devconnect anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'devconnect' and columnfamily_name = 'developers';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'devconnect' and columnfamily_name = 'companies';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'devconnect' and columnfamily_name = 'company_developers';
  • counter anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'counters_current_version';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'counters_with_expiry';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'counters';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'key_timestamp_count';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'timestamp_key';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'period_timestamp';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'counter' and columnfamily_name = 'gateway_quota';
  • cache anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'cache' and columnfamily_name = 'cache_entries';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'cache' and columnfamily_name = 'cache_sequence_id_r24';
  • ax_custom_report_model anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'report_description';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'report_id_lookup';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'org_metadata';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'org_report_lookup';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'report_created_view';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'ax_custom_report_model' and columnfamily_name = 'report_viewed_view';
  • auth anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'auth' and columnfamily_name = 'totp';
  • audit anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'audit' and columnfamily_name = 'audits';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'audit' and columnfamily_name = 'audits_ref';
  • apprepo anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apprepo' and columnfamily_name = 'organizations';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apprepo' and columnfamily_name = 'environments';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apprepo' and columnfamily_name = 'apiproxies';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apprepo' and columnfamily_name = 'apiproxy_revisions';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apprepo' and columnfamily_name = 'api_proxy_revisions_r21';
  • apimodel anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'apis';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'apis_revision';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'resource';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'method';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'revision_counters';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'template_counters';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'template';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'credentials';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'credentialsv2';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'schemas';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'security';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'apimodel' and columnfamily_name = 'template_auth';
  • identityzone anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'identityzone' and columnfamily_name = 'identityzones';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'identityzone' and columnfamily_name = 'orgtoidentityzone';
  • dek anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'dek' and columnfamily_name = 'keys';
  • analytics anahtar alanı için sıkıştırma stratejisini doğrulayacak CQL'ler:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'analytics' and columnfamily_name = 'custom_aggregates_defn';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'analytics' and columnfamily_name = 'custom_rules_defn';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'analytics' and columnfamily_name = 'custom_aggregates_defn_updates';
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'analytics' and columnfamily_name = 'custom_rules_defn_updates';