تغيير استراتيجية ضغط Cassandra

تستخدم Apigee قواعد بيانات Cassandra لتخزين معظم بياناتها، بما في ذلك بيانات الخوادم الوكيلة وذاكرات التخزين المؤقت والرموز المميّزة. التكثيف هو عملية عادية لتقليل حجم البيانات المخزّنة في قواعد البيانات، وهو أمر مهم للحفاظ على تشغيل قواعد البيانات بكفاءة. توفّر Cassandra استراتيجيات مختلفة للضغط. تنصح شركة Apigee جميع عملاء Edge for Private Cloud بتشغيل مجموعات Cassandra باستخدام استراتيجية LeveledCompactionStrategy بدلاً من الاستراتيجية التلقائية SizeTieredCompactionStrategy لجميع عائلات الأعمدة. يقدّم LeveledCompactionStrategy أداءً أفضل واستخدامًا أفضل للقرص وعمليات compaction أكثر فعالية، ويتطلّب مساحة خالية أقلّ من SizedTieredCompactionStrategy.

ستؤدي جميع عمليات التثبيت الجديدة من Apigee 4.51.00 أو الإصدارات الأحدث إلى إعداد Cassandra تلقائيًا باستخدام LeveledCompactionStrategy. ومع ذلك، إذا كنت تستخدم إصدارًا قديمًا من Apigee أو أجريت ترقية إلى Apigee 4.51.00 من إصدار قديم، قد يستمر إصدارك في استخدام Cassandra مع SizeTieredCompactionStrategy. لمعرفة استراتيجية التجميع التي يستخدمها إصدار Cassandra، اطّلِع على القسم التحقّق من استراتيجية التجميع.

توضّح هذه الصفحة كيفية تغيير استراتيجية التجميع إلى LeveledCompactionStrategy.

الإعداد

التحقّق من استراتيجية التجميع الحالية

للتحقّق من استراتيجية التجميع الحالية في عائلات الأعمدة، اتّبِع التعليمات الواردة في مقالة التحقّق من استراتيجية التجميع. إذا كانت استراتيجية التجميع LeveledCompactionStrategy، ليس عليك اتّباع التعليمات المتبقية في هذه الصفحة.

الاحتفاظ بنسخة احتياطية

بما أنّ تغيير استراتيجية التجميع يؤدي إلى بدء دورة تجميع كاملة في عقد C*، قد يؤدي ذلك إلى بعض حالات تأخُّر الاستجابة بسبب حمولة عمليات التجميع وعدد الزيارات المتزامنة للتطبيق. قد يكون من الضروري التراجع عن هذا التغيير لاستعادة عقد Cassandra من النُسخ الاحتياطية. اطّلِع على كيفية الاحتفاظ بنسخة احتياطية للتعرّف على كيفية الاحتفاظ بنسخة احتياطية من بياناتك قبل تغيير استراتيجية التجميع.

معدل نقل البيانات في عملية الضغط

بعد تغيير استراتيجية التجميع إلى LeveledCompactionStrategy، قد يتم تنفيذ عمليات التجميع لعدة أيام. قد يختلف وقت التشغيل حسب حجم تقليل البيانات. أثناء دورة التكثيف ، قد تستخدِم Cassandra المزيد من موارد النظام. لضمان عدم استغراق عملية التجميع الكثير من موارد النظام، ما قد يؤدي إلى إيقاف طلبات وقت تشغيل واجهة برمجة التطبيقات، ننصحك بتحديد حدود لمعدّل نقل البيانات في عملية التجميع.

شغِّل الأمر nodetool التالي على كل عقدة لضبط معدل نقل البيانات في عملية التجميع على الحد الأقصى عند 128 ميغابايت على جميع عقد C* ‏:

nodetool setcompactionthroughput 128

تحديد حجم الأجهزة الافتراضية لعمليات الضغط

تأكَّد من توفُّر موارد وحدة المعالجة المركزية/الذاكرة الكافية في عقد C* قبل تنفيذ هذا التغيير. تأكَّد من أنّه لا تعمل أيّ من عقد C* بأكثر من% 25 من حمولة وحدة المعالجة المركزية قبل تنفيذ هذا التغيير.

بعد تغيير استراتيجية التجميع، من المتوقّع أن يتم تشغيل دورة تجميع كاملة، لذا ننصح بتغيير استراتيجية التجميع خلال فترات انخفاض عدد الزيارات.

عمليات التنفيذ المتقطّعة

قد لا تتمكّن من إكمال تغيير جميع العقد في غضون يوم واحد، خاصةً إذا كنت تشغّل مجموعات Cassandra كبيرة، لأنّه يجب إعادة إنشاء الفهارس على كل عقدة واحدة تلو الأخرى. يمكنك تغيير استراتيجية التجميع لنموذج واحد أو عائلة أعمدة واحدة (جدول) في كل مرة. لهذا الغرض، عليك تغيير عائلة عمود لتغيير استراتيجية التجميع، ثم إعادة إنشاء جميع الفهارس في الجدول (إن توفّرت) على جميع العقد. بعد ذلك، كرِّر الإجراء أعلاه لكل جدول أو مساحة مفاتيح. يمكن تقسيم عمليات التشغيل هذه لجدول واحد أو مساحة مفاتيح واحدة كي يتم تنفيذها على مدار أيام مختلفة.

على سبيل المثال، لتغيير استراتيجية التجميع لمجموعة أعمدة oauth_20_access_tokens في مخطّط kms، يمكنك إجراء ما يلي:

  1. عدِّل الجدول لتغيير استراتيجية التجميع:
       
    ALTER TABLE kms.oauth_20_access_tokens WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  2. إعادة إنشاء جميع الفهارس لهذا الجدول فقط:
    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

تغيير استراتيجية التجميع

على مستوى عالٍ، يتطلّب تغيير استراتيجية التجميع تنفيذ خطوتَين:

  1. تعديل استراتيجية التجميع لكل جدول
  2. أعِد إنشاء جميع الفهارس على كل عقدة واحدة تلو الأخرى.

تغيير الجدول لضبط استراتيجية تجميع جديدة

شغِّل أوامر لغة طلب البحث Cassandra (CQL) التالية على أي عقدة من عقد Cassandra، مع تغيير استراتيجية لمساحة مفاتيح واحدة في كل مرة. يمكنك تنفيذ طلبات CQL عند ظهور الطلب cql. لعرض الطلب cql:

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

سيظهر لك ردّ مماثل لما يلي:

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>

شغِّل طلبات CQL التالية لتغيير استراتيجية التجميع:

  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح kms:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح user_settings:
    ALTER TABLE user_settings.user_settings WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح keyvaluemap:
       
    ALTER TABLE keyvaluemap.keyvaluemaps_r21 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح devconnect:
        
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح counter:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح cache:
    ALTER TABLE cache.cache_entries WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE cache.cache_sequence_id_r24 WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح ax_custom_report_model:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح auth:
    ALTER TABLE auth.totp WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح audit:
    ALTER TABLE audit.audits WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE audit.audits_ref WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح apprepo:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح apimodel:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح identityzone:
    ALTER TABLE identityzone.IdentityZones WITH compaction = {'class' : 'LeveledCompactionStrategy'};
    ALTER TABLE identityzone.OrgToIdentityZone WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح dek:
    ALTER TABLE dek.keys WITH compaction = {'class' : 'LeveledCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح analytics:
    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'};

إعادة إنشاء الفهارس

عليك تنفيذ هذه الخطوة بعد تغيير استراتيجية التجميع. شغِّل أوامر nodetool التالية واحدة تلو الأخرى على كل عقدة من عقد Cassandra.

شغِّل أوامر nodetool التالية لإعادة إنشاء الفهارس:

  • إعادة إنشاء الفهارس لمساحة المفاتيح kms:
    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:
    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:
        
    nodetool rebuild_index cache cache_entries cache_entries_cache_name_idx
  • إعادة إنشاء الفهارس لمساحة المفاتيح audit:
    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:
    nodetool rebuild_index apprepo environments environments_organization_name_idx
  • إعادة إنشاء الفهارس لمساحة المفاتيح apimodel:
    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:
    nodetool rebuild_index dek keys usecase_index

التحقّق

  1. تأكَّد من أنّ تغيير استراتيجية التجميع في المخطّط قد بدأ بتطبيقه باتّباع التعليمات الواردة في التحقّق من استراتيجية التجميع.
  2. تأكَّد من نجاح عملية التجميع وأنّه تم تجميع البيانات بعد تغيير الاستراتيجية:
    1. على كل عقدة من عقد cassandra، شغِّل الأمر nodetool التالي لمعرفة ما إذا كانت جميع عمليات التجميع قد اكتملت ولم يتبقّ أي عمليات في انتظار المراجعة:
      nodetool compactionstats
    2. بعد التحقّق من ذلك باستخدام الأمر أعلاه للتأكّد من عدم توفّر أي عمليات تجميع في انتظار المراجعة، تحقّق مما يلي: الطابع الزمني لآخر تعديل لملفات البيانات (ضمن ‎ /opt/apigee/data/apigee-cassandra/data/) أن يكون بعد الطابع الزمني الذي تم فيه تنفيذ CQL لتغيير استراتيجية التجميع.

التراجع

إذا كنت بحاجة إلى الرجوع إلى إصدار سابق، يمكنك اتّباع أحد الخيارَين أدناه:

الخيار 1: التراجع عن التغيير

أعِد استراتيجية التجميع إلى SizeTieredCompactionStrategy.

شغِّل طلبات CQL التالية على أي عقدة من عقد Cassandra لتغيير استراتيجية مساحة مفاتيح واحدة في كل مرة. يمكنك تنفيذ طلبات CQL عند ظهور الطلب cql. لعرض الطلب cql:

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

سيظهر لك ردّ مماثل لما يلي:

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>

شغِّل طلبات CQL التالية لتغيير استراتيجية التجميع:

  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح kms:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح user_settings:
    ALTER TABLE user_settings.user_settings WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح keyvaluemap:
    ALTER TABLE keyvaluemap.keyvaluemaps_r21 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح devconnect:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح counter:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح cache:
    ALTER TABLE cache.cache_entries WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE cache.cache_sequence_id_r24 WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح ax_custom_report_model:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح auth:
    ALTER TABLE auth.totp WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح audit:
    ALTER TABLE audit.audits WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE audit.audits_ref WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح apprepo:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح apimodel:
    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'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح identityzone:
    ALTER TABLE identityzone.IdentityZones WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
    ALTER TABLE identityzone.OrgToIdentityZone WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح dek:
        
    ALTER TABLE dek.keys WITH compaction = {'class' : 'SizeTieredCompactionStrategy'};
  • طلبات CQL لتغيير استراتيجية التجميع لمساحة المفاتيح analytics:
    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'};

بعد تغيير جميع عائلات الأعمدة، إذا سبق لك إعادة إنشاء الفهارس أثناء تغيير استراتيجية التجميع إلى LeveledCompactionStrategy، ستحتاج إلى إعادة إنشاء الفهارس مجددًا. اتّبِع الخطوات نفسها التي اتّبعتها سابقًا لإعادة إنشاء جميع الفهارس. إذا لم تُعدّ بناء الفهارس في وقت سابق، لن تحتاج إلى إعادة بناء الفهارس أثناء التراجع.

الخيار 2: استعادة البيانات بالكامل من النسخة الاحتياطية

لإجراء عملية استعادة كاملة للبيانات، اطّلِع على التعليمات الواردة في الاستعادة من نسخة احتياطية.

التحقّق من استراتيجية التجميع

يتمّ ضبط استراتيجيات التجميع على مستوى عائلة الأعمدة (الجدول) في Cassandra. يمكنك استخدام طلبات بحث CQL أدناه للتحقّق من استراتيجية التجميع لكل عائلة أعمدة.

يمكنك تنفيذ طلبات CQL عند ظهور الطلب cql. لاستدعاء طلب cql:

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

سيظهر لك ردّ مماثل لما يلي:

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>

يمكنك تحديد استراتيجية التجميع الحالية على النحو التالي:

  • إذا تم ضبط استراتيجية التجميع على SizeTieredCompactionStrategy، سيكون الناتج لطلبات البحث أدناه هو org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy.
  • إذا تم ضبط استراتيجية التجميع على LeveledCompactionStrategy، سيكون الناتج من طلبات البحث أدناه هو org.apache.cassandra.db.compaction.LeveledCompactionStrategy.

شغِّل طلبات CQL التالية للتحقّق من استراتيجية التجميع:

  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح kms:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح user_settings:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'user_settings' and columnfamily_name = 'user_settings';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح keyvaluemap:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'keyvaluemap' and columnfamily_name = 'keyvaluemaps_r21';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح devconnect:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح counter:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح cache:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح ax_custom_report_model:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح auth:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'auth' and columnfamily_name = 'totp';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح audit:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح apprepo:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح apimodel:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح identityzone:
    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';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح dek:
    SELECT compaction_strategy_class from system.schema_columnfamilies where keyspace_name = 'dek' and columnfamily_name = 'keys';
  • طلبات CQL للتحقّق من استراتيجية التجميع لمساحة المفاتيح analytics:
    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';