Logo

Personal Ops Runbook

Personal runbook covering infrastructure operations for Cloud, Kubernetes, OpenStack, and Ceph environments. Includes deployment and teardown procedures, node management, cluster monitoring setup, and incident response workflows compiled from day-to-day operational work. Intended strictly for personal reference — configurations and scripts are environment-specific and not guaranteed to work as-is elsewhere.

[Swift] – Phần 7: Kiểm tra hoạt động của OpenStack Swift


Nếu bạn đang sử dụng Red Hat Enterprise Linux 7 hoặc CentOS 7 có thể sẽ có một hoặc nhiều bước không hoạt động, hãy kiểm tra file /var/log/audit/audit.log để xem có thông báo SELinux nào từ chối các hành động cho các quy trình Swift hay không.

Tài liệu tham khảo: https://docs.openstack.org/swift/latest/install/

Nếu có, bạn hãy thay đổi bảo mật của thư mục /srv/node thành mức bảo mật thấp nhất (s0) cho loại swift_data_t, vai trò object_r và người dùng system_u.

chcon -R system_u:object_r:swift_data_t:s0 /srv/node

Sử dụng các thông tin xác thực demo:

. demo-openrc

Chạy lệnh swift stat để hiển thị trạng thái dịch vụ:

shell> swift stat
                        Account: AUTH_ed0b60bf607743088218b0a533d5943f
                     Containers: 0
                        Objects: 0
                          Bytes: 0
    X-Account-Project-Domain-Id: default
                    X-Timestamp: 1444143887.71539
                     X-Trans-Id: tx1396aeaf17254e94beb34-0056143bde
         X-Openstack-Request-Id: tx1396aeaf17254e94beb34-0056143bde
                   Content-Type: text/plain; charset=utf-8
                  Accept-Ranges: bytes

Tạo container container1:

shell> openstack container create container1
+---------------------------------------+------------+------------------------------------+
| account                               | container  | x-trans-id                         |
+---------------------------------------+------------+------------------------------------+
| AUTH_ed0b60bf607743088218b0a533d5943f | container1 | tx8c4034dc306c44dd8cd68-0056f00a4a |
+---------------------------------------+------------+------------------------------------+

Tải lên một file thử nghiệm vào container container1 (thay FILE bằng tên của file nào đó dùng để tải lên container1).

shell> openstack object create container1 FILE
+--------+------------+----------------------------------+
| object | container  | etag                             |
+--------+------------+----------------------------------+
| FILE   | container1 | ee1eca47dc88f4879d8a229cc70a07c6 |
+--------+------------+----------------------------------+

Liệt kê các file có trong container1:

shell> openstack object list container1
+------+
| Name |
+------+
| FILE |
+------+

Tải xuống một file thử nghiệm từ container1:

openstack object save container1 FILE

Thay FILE bằng tên của file đã tải lên container1.

Lệnh này không cung cấp bất kỳ đầu ra nào.