Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 02-10-2009, 10:55 AM   #1
emailhoc
Administrator
 
Gia nhập: Jul 2009
Trả Lời: 245
Một số lệnh quản lý cơ bản trong Virtuozzo
I. Quản lý Container:

Tạo mới Container với OS template là fedora-core-8-x86 sử dụng cấu hình lấy từ file ct-basic.conf-sample

Mã:
# vzctl create 101 --ostemplate fedora-core-8-x86 -–config basic
Thiết đặt thông số mạng cho Container

Mã:
# vzctl set 101 --hostname test101.swsoft.com --save --> đặt Hostname cho Container
Mã:
vzctl set 101 --ipadd 10.0.186.1 --save --> đặt địa chỉ IP cho Container
Mã:
vzctl set 101 --nameserver 192.168.1.165 --save --> đặt DNS cho Container
Mã:
# vzctl exec 101 service sshd status --> Kiểm tra trạng thái của dịch vụ SSH
Đặt password cho tài khoản root của container

Mã:
# vzctl start 101 --> Khởi động Container 101
[This command starts Container 101, if it is not started yet] 
# vzctl set 101 --userpasswd root:test --> đặt password là "test" cho root
Khởi động, tắt, khởi động lại và kiểm tra tình trạng container

Mã:
# vzctl start 101 --> Khởi động Container 101
Starting Container ... 
Setup slm memory limit 
Setup slm subgroup (default) 
Setting devperms 20002 dev 0x7d0
Adding port redirection to Conta
Adding IP address(es) to pool:  
Adding IP address(es): 10.14.14.
Hostname for Container set: loca
Container start in progress...
Mã:
# vzctl status 101 --> Xem tình trạng hiện tại của Container 101
CTID 101 exists mounted running
Mã:
# vzlist 101 --> liệt kê thông tin về Container 101
CTID       NPROC STATUS  IP_ADDR         HOSTNAME        
 101         20 running 10.0.186.101     test.swsoft.com
Mã:
# vzctl stop 101 --> tạm dừng Container 101
Stopping Container ... 
Container was stopped 
Container is unmounted
Mã:
# vzctl restart 101 --> khởi động lại Container 101
Stopping Container ... 
Container was stopped 
Container is unmounted 
Starting Container ... 
... 
Container start in progress...

Liệt kê danh sách các Container


Mã:
# vzlist -a --> Liệt kê danh sách các container hiện có trên hệ thống 
      CTID      NPROC STATUS  IP_ADDR         HOSTNAME        
         1         35 running 10.101.60.79    localhost 
       101          8 running 10.101.66.1     ct101.swsoft.com 
       102          7 running 10.101.66.159   ct102.swsoft.com 
       103          - stopped 10.101.66.103   ct103.swsoft.com
Xóa Container

Mã:
# vzctl stop 101 --> tắt Container 101
Stopping Container ... 
Container was stopped 
Container is unmounted 
# vzctl delete 101 --> xóa Container 101
Deleting Container private area: /vz/private/101 
Container private area was deleted
II/ Quản lý Application

Cài đặt Application Template trên Harware Node

Mã:
# vzpkg install template mysql-fedora-core-8-x86-tmpl-4.0.0-2.swsoft.rpm --> cài đặt template MySQL cho Hardware Node 
Preparing...                   ############################# [100%] 
   1:mysql-fedora-core-8-x86   ############################# [100%]
Thêm Application cho Container

Mã:
# vzpkg install 101 mysql --> Cài MySQL cho container 101
... 
Installed: 
 mysql                  i386      0:4.1.12-3.FC8.1 
 mysql-bench            i386      0:4.1.12-3.FC8.1 
 mysql-devel            i386      0:4.1.12-3.FC8.1
Xem danh sách các template đã được cài đặt trên Hardware Node

Mã:
# vzpkg list 
fedora-core-6-x86 
fedora-core-6-x86   mysql
Xem danh sách các template đã được cài đặt trên Container

Mã:
# vzpkg list 101 
fedora-core-8-x86                 2007-05-21 02:21:56 
fedora-core-8-x86   mysql         2007-05-21 05:36:42
Gỡ bỏ ứng dụng khỏi Container

Mã:
# vzpkg remove 101 mysql --with  -> Gỡ bỏ MySQL khỏi Container 101
vzpkg remove 101 mysql 
Removed: 
 mysql 
 mysql-server 
 mysql-devel 
 mysql-bench 
 perl-DBD-MySQL

Last edited by emailhoc; 02-10-2009 at 11:18 AM..
emailhoc vắng mặt   Trả lời ngay kèm theo trích dẫn này
Tuổi 21-02-2011, 02:02 PM   #2
hoctinhoc
Guest
 
Trả Lời: n/a
Lenh nay de backup container co id: 120 tren hardware node local

Mã:
vzabackup localhost -e 120
Mã:
vzarestore --list --full
  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời



Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 09:15 AM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.