اداره کردن پایگاه داده PostgreSQL درصورت ازکارافتادگی

Edge for Private Cloud نسخه ۴.۱۶.۰۵

درطول انتقال خودکار به پایگاه داده پشتیبان PostgreSQL، موارد زیر را انجام دهید:

  1. ‫apigee-postgresql را در سرور اصلی فعلی متوقف کنید (اگر هنوز درحال اجرا است):
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
  2. Go to standby node and invoke the following command to make it the master:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql promote-standby-to-master IPorDNSofOldMaster

اگر گره اصلی قدیمی در آینده بازیابی شد، آن را به گره آماده‌به‌کار تبدیل کنید:

  1. در Master فعلی، فایل پیکربندی را ویرایش کنید تا موارد زیر را تنظیم کنید:
    PG_MASTER=IPorDNSofNewMaster
    PG_STANDBY=IPorDNSofOldMaster
  2. Enable replication on the new master:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f configFIle
  3. در سرور اصلی قدیمی، فایل پیکربندی را ویرایش کنید تا موارد زیر را تنظیم کنید:
    PG_MASTER=IPorDNSofNewMaster
    PG_STANDBY=IPorDNSofOldMaster
  4. apigee-postgresql را در سرور اصلی قدیمی متوقف کنید:
    > /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
  5. On the old master, clean out any old Postgres data:
    > rm -rf /<inst_root>/apigee/data/apigee-postgresql/

    Note: If necessary, you can backup this data before deleting it.
  6. Configure the old master as a standby:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f configFile
  7. پس‌از تکمیل تکرار، وضعیت تکرار را با صدور اسکریپت‌های زیر در هر دو سرور درستی‌سنجی کنید. سیستم باید نتایج یکسانی را در هر دو سرور نمایش دهد تا از تکرار موفقیت‌آمیز اطمینان حاصل شود:
    1. در گره اصلی، این دستور را اجرا کنید:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master

      اعتبارسنجی کنید که می‌گوید گره اصلی است.
    2. On the standby node:
      > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby

      Validate that it says it is the standby.