Cách cài đặt lại và khôi phục các thành phần

Edge cho đám mây riêng tư phiên bản 4.16.05

Tài liệu này trình bày về việc cài đặt lại và khôi phục một thành phần Edge. Hãy sử dụng quy trình này nếu bạn phải cài đặt lại thành phần Edge trước khi khôi phục bản sao lưu.

Apache ZooKeeper

Khôi phục một nút độc lập

  1. Dừng ZooKeeper:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper stop
  2. Xoá các thư mục ZooKeeper cũ:
    /<inst_root>/apigee/data/apigee-zookeeper
    /<inst_root>/apigee/etc/apigee-zookeeper.d
  3. Cài đặt lại ZooKeeper:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper install
  4. Khôi phục ZooKeeper.
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại tất cả thành phần:
    > /<inst_root>/apigee/apigee-service/bin/apigee-all restart

Khôi phục một nút cụm

Nếu một nút ZooKeeper duy nhất bị lỗi trong một tập hợp, bạn có thể tạo một nút mới có cùng tên máy chủ/địa chỉ IP và cài đặt lại ZooKeeper. Khi nút ZooKeeper mới tham gia vào nhóm ZooKeeper, nút này sẽ nhận được ảnh chụp nhanh mới nhất từ Trưởng nhóm và bắt đầu phục vụ ứng dụng. Bạn không cần khôi phục dữ liệu trong trường hợp này.

  1. Cài đặt lại ZooKeeper:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper install
  2. Chạy quy trình thiết lập trên nút ZooKeeper bằng cùng một tệp cấu hình được dùng khi cài đặt nút ban đầu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper setup -f configFile
  3. Bắt đầu ZooKeeper:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-zookeeper start

Khôi phục toàn bộ cụm

  1. Dừng toàn bộ cụm.
  2. Khôi phục tất cả các nút ZooKeeper từ tệp sao lưu như mô tả ở trên cho một nút.
  3. Khởi động cụm ZooKeeper.
  4. Khởi động lại tất cả thành phần.

Apache Cassandra

Khôi phục một nút độc lập

  1. Dừng Cassandra:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra stop
  2. Xoá các thư mục Cassandra cũ:
    /<inst_root>/apigee/data/apigee-cassandra
    /<inst_root>/apigee/etc/apigee-cassandra.d
  3. Cài đặt lại Cassandra:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra install
  4. Khôi phục Cassandra:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại tất cả thành phần:
    > /<inst_root>/apigee/apigee-service/bin/apigee-all restart

Khôi phục một nút cụm

Nếu một nút Cassandra bị lỗi, tức là một phần của tập hợp, bạn có thể tạo một nút mới có cùng tên máy chủ/địa chỉ IP. Bạn chỉ cần cài đặt lại Cassandra mà không cần khôi phục dữ liệu.

Lưu ý: Khi cài đặt lại trên một nút không phải nút gốc, hãy đảm bảo rằng ít nhất một nút gốc Cassandra đang hoạt động.

  1. Cài đặt lại Cassandra:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra install
  2. Chạy quy trình thiết lập trên nút Cassandra bằng cùng một tệp cấu hình được dùng khi cài đặt nút ban đầu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra setup -f configFile
  3. Bắt đầu Cassandra:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-cassandra start
  4. Sau khi cài đặt Cassandra và nút hoạt động (với điều kiện RF>=2 cho tất cả không gian khoá), hãy thực thi lệnh nodetool sau để khởi động nút:
    <inst_root>/apigee/apigee-cassandra/bin/nodetool -h localhost repair

Khôi phục toàn bộ cụm

  1. Dừng toàn bộ cụm.
  2. Khôi phục tất cả các nút Cassandra từ tệp sao lưu.
  3. Khởi động cụm Cassandra.
  4. Khởi động lại tất cả thành phần.

Cơ sở dữ liệu PostgreSQL

PosgreSQL chạy độc lập hoặc dưới dạng Master

  1. Dừng Máy chủ quản lý, Máy chủ Qpid và Máy chủ Postgres trên tất cả các nút:
    Lưu ý: Hệ thống của bạn vẫn có thể xử lý các yêu cầu đến proxy API trong khi các thành phần này bị dừng.
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server stop
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server stop
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
  2. Cài đặt lại cơ sở dữ liệu PostgreSQL:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql install
  3. Bắt đầu PostgreSQL:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql start
  4. Khôi phục cơ sở dữ liệu PostgreSQL từ tệp sao lưu:
    /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql restore 2016.03.17,14.40.41.dump
  5. Khởi động Máy chủ quản lý, Máy chủ Qpid và Máy chủ Postgres trên tất cả các nút:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server start
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server start
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server start

PostgreSQL đang chạy ở chế độ chờ

  1. Cài đặt lại cơ sở dữ liệu PostgreSQL:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql install
  2. Định cấu hình lại cơ sở dữ liệu PostgreSQL bằng cùng một tệp cấu hình mà bạn đã dùng để cài đặt:
    /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql setup -f configFile
  3. Bắt đầu PostgreSQL:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-postgresql start

Máy chủ Postgres

  1. Dừng Máy chủ Postgres trên tất cả các nút chính và nút dự phòng:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
  2. Xoá các thư mục Postgres Server cũ:
    /<inst_root>/apigee/data/edge-postgres-server
    /<inst_root>/apigee/etc/edge-postgres-server.d
  3. Cài đặt lại Máy chủ Postgres:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server install
  4. Khôi phục Máy chủ Postgres từ tệp sao lưu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động Máy chủ Postgres trên tất cả các nút chính và nút dự phòng:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server start

Máy chủ Qpid và Qpidd

  1. Dừng Qpidd, Máy chủ Qpid và Máy chủ Postgres trên tất cả các nút:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server stop
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server stop
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-qpidd stop
  2. Xoá các thư mục Qpid Server và Qpidd cũ:
    /<inst_root>/apigee/data/edge-qpid-server
    /<inst_root>/apigee/etc/edge-qpid-server.d
    /<inst_root>/apigee/data/apigee-qpidd
    /<inst_root>/apigee/etc/apigee-qpidd.d
  3. Cài đặt lại Qpidd:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-qpidd install
  4. Khôi phục Qpidd:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-qpidd restore backup-2016.03.17,14.40.41.tar.gz
  5. Bắt đầu Qpidd:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-qpidd start
  6. Cài đặt lại Máy chủ Qpid:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server install
  7. Khôi phục máy chủ Qpid:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server restore backup-2016.03.17,14.40.41.tar.gz
  8. Khởi động lại Máy chủ Qpid, Qpidd và Máy chủ Postgres trên tất cả các nút:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-qpidd restart
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-postgres-server restart

OpenLDAP

  1. Dừng OpenLDAP:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-openldap stop
  2. Cài đặt lại OpenLDAP:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-openldap install
  3. Xoá các thư mục OpenLDAP cũ:
    /<inst_root>/apigee/data/apigee-openldap
    /<inst_root>/apigee/etc/apigee-openldap.d
  4. Khôi phục OpenLDAP:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-openldap restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại OpenLDAP:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service apigee-openldap start
  6. Khởi động lại tất cả Máy chủ quản lý:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server restart

Máy chủ quản lý

  1. Dừng máy chủ quản lý:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server stop
  2. Xoá các thư mục Máy chủ quản lý cũ:
    /<inst_root>/apigee/data/edge-management-server
    /<inst_root>/apigee/etc/edge-management-server.d
  3. Cài đặt lại Máy chủ quản lý:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server install
  4. Khôi phục Máy chủ quản lý từ tệp sao lưu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại Máy chủ quản lý:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-management-server start

Bộ xử lý thông báo

  1. Dừng Bộ xử lý thông báo:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-message-processor stop
  2. Xoá các thư mục cũ của Bộ xử lý thông báo:
    /<inst_root>/apigee/data/edge-message-processor
    /<inst_root>/apigee/etc/edge-message-processor.d
  3. Cài đặt lại Trình xử lý thông báo:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-message-processor install
  4. Khôi phục Bộ xử lý thông báo từ tệp sao lưu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-message-processor restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại Trình xử lý thông báo:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-message-processor start

Bộ định tuyến

  1. Dừng Bộ định tuyến:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router stop
  2. Xoá các thư mục Bộ định tuyến cũ:
    /<inst_root>/apigee/data/edge-router
    /<inst_root>/apigee/etc/edge-router.d
  3. Cài đặt lại Bộ định tuyến:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router install
  4. Khôi phục Bộ định tuyến từ tệp sao lưu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại Bộ định tuyến:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-router start

Giao diện người dùng Edge

  1. Dừng giao diện người dùng:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-ui stop
  2. Xoá các thư mục giao diện người dùng cũ:
    /<inst_root>/apigee/data/edge-ui
    /<inst_root>/apigee/etc/edge-ui.d
  3. Cài đặt lại giao diện người dùng:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-ui install
  4. Khôi phục giao diện người dùng từ tệp sao lưu:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-ui restore backup-2016.03.17,14.40.41.tar.gz
  5. Khởi động lại giao diện người dùng:
    > /<inst_root>/apigee/apigee-service/bin/apigee-service edge-ui start

Hoàn tất quá trình khôi phục trang web

  1. Dừng tất cả các nút thành phần. Lưu ý rằng thứ tự dừng các hệ thống con là rất quan trọng – trước tiên là tất cả các nút Edge, sau đó là tất cả các nút kho dữ liệu.
  2. Khôi phục tất cả thành phần như mô tả ở trên.
  3. Bây giờ, hãy khởi động tất cả các thành phần theo thứ tự sau. Lưu ý rằng thứ tự khởi động các hệ thống con là rất quan trọng:
    1. Bắt đầu cụm ZooKeeper
    2. Bắt đầu cụm Cassandra
    3. Đảm bảo rằng OpenLDAP đang hoạt động
    4. Bắt đầu qpid
    5. Đảm bảo rằng cơ sở dữ liệu PostgreSQL đang hoạt động
    6. Khởi động máy chủ quản lý
    7. Bắt đầu Bộ định tuyến và Bộ xử lý thông báo
    8. Khởi động máy chủ Qpid
    9. Khởi động máy chủ Postgres
    10. Khởi động giao diện người dùng Apigee