June 4, 2015

Thêm/Xóa SSD cache trên Cluster Virtuozzo đang hoạt động

1. Thêm SSD vào PCS
* Parallels Cloud Storage hỗ trợ định dạng filesystem EXT4
* Sử dụng lệnh “lsscsi” để kiểm tra ổ đĩa vừa thêm vào.
Bước 1: Phân vùng ổ đĩa và mount vào storage
– Phân vùng ổ đĩa với công cụ prepare_pstorage_drive.
#/usr/libexec/pstorage/prepare_pstorage_drive /dev/sdc [--ssd]
ALL data on /dev/sdb will be completely destroyed. Are you sure to continue? [y]
y
Zeroing out beginning and end of /dev/sdc…
Partitioning /dev/sdc…
Waiting for kernel…
Formatting /dev/sdc1 partition…
Done!
– Tạo thư mục ssd0 vào storage
# mkdir /pstorage/ssd0
# mount /dev/sdc2 /pstorage/ssd0

– Chỉnh sửa file /etc/fstab

# blkid /dev/sdc2
/dev/sdc2: UUID="8ff4cc2f-01d7-470c-a28c-40722ad918c1" TYPE="ext4"

Thêm vào /etc/fstab dòng: UUID=8ff4cc2f-01d7-470c-a28c-40722ad918c1 /pstorage/ssd0 ext4 defaults,noatime 1 2
Bước 2: Cấu hình write journaling (CS)
– Sử dụng advise-configuration của PCS để xem trước những khuyến cáo về cấu hình journal cache do PCS đề xuất phù hợp với từng hệ thống.

# pstorage -c ods-cloud advise-configuration --cs /pstorage/ods-cloud-cs \
--cs /pstorage/ods-cloud-cs1 --ssd /pstorage/ssd0 -m /pstorage/ods-cloud
You have the following setup:
CS on /pstorage/ods-cloud-cs1 — Total disk space 457.9GB
CS on /pstorage/ods-cloud-cs — Total disk space 395.6GB
SSD on /pstorage/ssd0 — Total disk space 219.5GB
Proposed server configuration
– 98.3GB (44%) for CS journals, 98.3GB (44%) for mount read cache on /pstorage/ssd0,
22.7GB (10%) reserved (including 853MB checksums for 853.5GB of data)
– CS journal sizes:
52.7GB for /pstorage/ods-cloud-cs1 at /pstorage/ssd0
45.6GB for /pstorage/ods-cloud-cs at /pstorage/ssd0
How to setup the node:
pstorage -c ods-cloud make-cs -r /pstorage/ods-cloud-cs1/cs -j /pstorage/ssd0/cs2-ods-cloud-journal -s 54055
pstorage -c ods-cloud make-cs -r /pstorage/ods–cs/cs -j /pstorage/ssd0/cs1-ods-cloud-journal -s 46696
pstorage-mount -c ods-cloud /pstorage/ods-cloud -C /pstorage/ssd0/pstorage-ods-cloud-cache -R 100751
Mount option for automatic cluster mount from /etc/fstab:
pstorage://ods-cloud /pstorage/ods-cloud fuse.pstorage cache=/pstorage/ssd0/pstorage-ods-cloud-cache,cachesize=100751

– Dừng dịch vụ pstorage-csd

services pstorage-csd stop

– Add write journal với journal size theo advise-configuration

pstorage -c ods-pcs configure-cs -r /pstorage/ods-cloud-cs --add-journal /pstorage/ssd0/journal-ods-cloud-cs -s 54055
pstorage -c ods-pcs configure-cs -r /pstorage/ods-cloud-cs --add-journal /pstorage/ssd0/journal-ods-cloud-cs -s 46696
– Khởi động lại dịch vụ pstorage-csd

services pstorage-csd start

Bước 3: Cấu hình data caching (client cache)
– Dừng dịch vụ pstorage-fs và vz

services pstorage-fs stop
services vz stop
– Theo advise-configuration ở trên thực hiện lệnh

pstorage-mount -c ods-cloud /pstorage/ods-cloud -C /pstorage/ssd0/pstorage-ods-cloud-cache -R 100751

– Thêm vào /etc/fstab dòng:
pstorage://ods-cloud /pstorage/ods-cloud fuse.pstorage cache=/pstorage/ssd0/pstorage-cloud-cache,cachesize=100751
– Khởi động lại dịch vụ pstorage-fs và vz

services pstorage-fs start
services vz start
2. Xóa SSD cache ra khỏi PCS
Bước 1: Remove write cache (journal cache)
– Tiến hành unlink hoặc hủy journal:

# pstorage -c ods-cloud configure-cs --repo-dir /pstorage/ods-cloud-cs/data --destroy-journal
# pstorage -c ods-cloud configure-cs --repo-dir /pstorage/ods-cloud-cs1/data --destroy-journal

Hoặc bạn cũng có thể unlink ssd:

# pstorage -c ods-cloud configure-cs --repo-dir /pstorage/ods-cloud-cs/data --unlink-journal
# pstorage -c ods-cloud configure-cs --repo-dir /pstorage/ods-cloud-cs1/data --unlink-journal

– Khởi động lại dịch vụ pstorage-csd

services pstorage-csd restart

Bước 2: Remove data caching (client cache)
– Để có thể remove được cache của client bạn cần phải stop tất cả các VM và CT hoặc dời các VM và CT qua Hardware Node khác. Sau đó tiếp tục stop các dịch vụ pstorage-fs và vz

services pstorage-fs stop
services vz stop

– Umount ổ đĩa SSD:

umount /pstorage/ssd0

– Khởi động lại dịch vụ pstorage-cs và vz.

services pstorage-fs start
services vz start

*Nếu bạn không muốn sử dụng và rút SSD ra khỏi Hardware Node có thể sử dụng lênh

echo 1 > /sys/block/sdc/device/delete


nguồn: https://www.ods.vn/TaiLieu/ChiTiet/virtuozzo_storage/them_xoa_ssd_cache_tren_cluster_virtuozzo_dang_hoat_dong

Related Posts:

  • Tạo và quản lý Private network cho VM/CT trên Virtuozzo Private network Dùng để tạo 1 vùng network private về mặt logic giữa các địa chỉ IP trực thuộc Private network đó, cách ly các IP này với bên ngoài. Lúc này thì chỉ có các IP thành viên mới giao tiếp được với nhau. Để tạo… Read More
  • Quản lý Disk I/O cho VM/CT trên Virtuozzo PCS cho phép cấu hình độ ưu tiên về I/O giữa các Container và VM. Có thể thay đổi giá trị ưu tiên về I/O bằng tham số “ioprio.” #prlctl set MyVM --ioprio 6 #prlctl set 101 --ioprio 6 Tham số –ioprio có giá trị từ 0 đến 7,… Read More
  • Chú ý khi thực hiện Yum update Hardware node Virtuozzo Để update 1 node trong cluster PCS, Parallels khuyến khích người dùng thực hiện theo các hướng dẫn bên dưới. Điều này rất quan trọng, vì nó sẽ giảm thời gian downtime của các VM và Container xuống mức thấp nhất. Lưu ý l… Read More
  • Thêm mới ổ đĩa và chunk trên Virtuozzo Storage Thêm mới ổ đĩa và chunk trên Virtuozzo Storage PCS rất linh hoạt trong việc mở rộng storage. Khi có nhu cầu mở rộng dung lượng storage bạn sẽ thêm ổ đĩa vào. Các bước thêm chunk mới vào cluster: 1. Thêm HDD/SSD vào PCS… Read More
  • Quản lý CPU limits trên Virtuozzo Giới hạn CPU cho Containers và VM trên Parallels Server Bare Metal ( PSBM ),  Parallels Virtuozzo. Việc giới hạn sử dụng CPU trên các Container hoặc VM được xác định theo các tham số sau.Cpus:  Tham số nà… Read More

1 comment:

  1. Vui lòng thêm nguồn vào cuối bài viết để tôn trọng tác giả nhé bạn.

    ReplyDelete