天天看點

kvm虛拟化學習筆記(十九)之convirt集中管理平台搭建

(1)本文采用CentOSx86_64作業系統,需要有KVM安裝環境。

(2)convirt2.1.1采用源碼方式安裝,convirt環境分别兩部分,一部分是cms,用于管理kvm/xen虛拟主機上的虛拟機,一部分做為用戶端安裝到kvm/xen虛拟主機上。

(3)convirt2.1.1是開源的管理xen/kvm虛拟化管理工具,是衆多開源工具中的一種。

<code># cd /etc/yum.repos.d</code>

<code># wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo</code>

<code># cd /root/</code>

<code># wget --no-cache http://www.convirture.com/downloads/convirt/2.1.1/convirt-2.1.1.tar.gz</code>

<code># wget --no-cache http://www.convirture.com/downloads/convirt/2.1.1/convirt-install-2.1.1.tar.g</code>

<code># tar -xzvf convirt-install-2.1.1.tar.gz</code>

<code># cd convirt-install/install/cms/scripts/ &amp;&amp; ./install_dependencies</code>

<code>…</code>

<code>chmod</code> <code>755 blib</code><code>/arch/auto/HTML/Parser/Parser</code><code>.so</code>

<code>cp</code> <code>Parser.bs blib</code><code>/arch/auto/HTML/Parser/Parser</code><code>.bs</code>

<code>chmod</code> <code>644 blib</code><code>/arch/auto/HTML/Parser/Parser</code><code>.bs</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::PullParser.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::Entities.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::Parser.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::TokeParser.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::LinkExtor.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::Filter.3pm</code>

<code>Manifying blib</code><code>/man3/HTML</code><code>::HeadParser.3pm</code>

<code>Files found </code><code>in</code> <code>blib</code><code>/arch</code><code>: installing files </code><code>in</code> <code>blib</code><code>/lib</code> <code>into architecture dependent library tree</code>

<code>Installing </code><code>/usr/local/lib64/perl5/auto/HTML/Parser/Parser</code><code>.bs</code>

<code>Installing </code><code>/usr/local/lib64/perl5/auto/HTML/Parser/Parser</code><code>.so</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/HeadParser</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/PullParser</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/LinkExtor</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/Filter</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/Entities</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/Parser</code><code>.pm</code>

<code>Installing </code><code>/usr/local/lib64/perl5/HTML/TokeParser</code><code>.pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::Entities.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::TokeParser.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::PullParser.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::Parser.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::LinkExtor.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::Filter.3pm</code>

<code>Installing </code><code>/usr/local/share/man/man3/HTML</code><code>::HeadParser.3pm</code>

<code>Appending installation info to </code><code>/usr/lib64/perl5/perllocal</code><code>.pod</code>

<code>SUDO is </code>

<code>Starting mysqld:                                           [  OK  ]</code>

<code>Running mysql_secure_installation.</code>

<code>Current root password </code><code>for</code> <code>fresh installation is blank. So simple press enter.</code>

<code>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL</code>

<code>      </code><code>SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!</code>

<code>In order to log into MySQL to secure it, we'll need the current</code>

<code>password </code><code>for</code> <code>the root user.  If you've just installed MySQL, and</code>

<code>you haven't </code><code>set</code> <code>the root password yet, the password will be blank,</code>

<code>so you should just press enter here.</code>

<code>Enter current password </code><code>for</code> <code>root (enter </code><code>for</code> <code>none): </code>

<code>ERROR 1045 (28000): Access denied </code><code>for</code> <code>user </code><code>'root'</code><code>@</code><code>'localhost'</code> <code>(using password: YES)</code>

<code>OK, successfully used password, moving on...</code>

<code>Setting the root password ensures that nobody can log into the MySQL</code>

<code>root user without the proper authorisation.</code>

<code>Set root password? [Y</code><code>/n</code><code>] y</code>

<code>New password: </code>

<code>Re-enter new password: </code>

<code>Password updated successfully!</code>

<code>Reloading privilege tables..</code>

<code> </code><code>... Success!</code>

<code>By default, a MySQL installation has an anonymous user, allowing anyone</code>

<code>to log into MySQL without having to have a user account created </code><code>for</code>

<code>them.  This is intended only </code><code>for</code> <code>testing, and to </code><code>make</code> <code>the installation</code>

<code>go a bit smoother.  You should remove them before moving into a</code>

<code>production environment.</code>

<code>Remove anonymous </code><code>users</code><code>? [Y</code><code>/n</code><code>] y</code>

<code>Normally, root should only be allowed to connect from </code><code>'localhost'</code><code>.  This</code>

<code>ensures that someone cannot guess at the root password from the network.</code>

<code>Disallow root login remotely? [Y</code><code>/n</code><code>] y</code>

<code>By default, MySQL comes with a database named </code><code>'test'</code> <code>that anyone can</code>

<code>access.  This is also intended only </code><code>for</code> <code>testing, and should be removed</code>

<code>before moving into a production environment.</code>

<code>Remove </code><code>test</code> <code>database and access to it? [Y</code><code>/n</code><code>] y</code>

<code> </code><code>- Dropping </code><code>test</code> <code>database...</code>

<code> </code><code>- Removing privileges on </code><code>test</code> <code>database...</code>

<code>Reloading the privilege tables will ensure that all changes made so far</code>

<code>will take effect immediately.</code>

<code>Reload privilege tables now? [Y</code><code>/n</code><code>] y</code>

<code>Cleaning up...</code>

<code>All </code><code>done</code><code>!  If you've completed all of the above steps, your MySQL</code>

<code>installation should now be secure.</code>

<code>Thanks </code><code>for</code> <code>using MySQL!</code>

<code>mysqld (pid  1627) is running...</code>

<code>MySQL service is already running.</code>

<code>Prerequsite </code><code>for</code> <code>ConVirt Management Server (CMS) installed.</code>

說明:安裝過程會安裝mysql資料庫,并輸入mysql資料庫root帳号密碼。

<code>[root@localhost scripts]</code><code># vim /etc/my.cnf</code>

<code>[root@localhost scripts]</code><code># cat /etc/my.cnf </code>

<code>[mysqld]</code>

<code>datadir=</code><code>/var/lib/mysql</code>

<code>socket=</code><code>/var/lib/mysql/mysql</code><code>.sock</code>

<code>user=mysql</code>

<code># Disabling symbolic-links is recommended to prevent assorted security risks</code>

<code>symbolic-links=0</code>

<code>innodb_buffer_pool_size=1G</code>

<code>innodb_additional_mem_pool_size=20</code>

<code>[mysqld_safe]</code>

<code>log-error=</code><code>/var/log/mysqld</code><code>.log</code>

<code>pid-</code><code>file</code><code>=</code><code>/var/run/mysqld/mysqld</code><code>.pid</code>

<code>[root@localhost scripts]</code><code># </code>

<code>[root@localhost scripts]</code><code># /etc/init.d/mysqld restart</code>

<code>Stopping mysqld:                                           [  OK  ]</code>

<code>[root@localhost scripts]</code><code>#</code>

<code># cd convirt-install/install/cms/scripts/ &amp;&amp; source install_config</code>

<code># cd /root &amp;&amp; tar -xzf convirt-2.1.1.tar.gz -C $CONVIRT_BASE</code>

<code># cd -</code>

<code># ./setup_tg2   #建議更新python版本為2.7</code>

<code># ./setup_convirt</code>

啟動convirt

<code># /root/convirt/convirt-ctl start</code>

關閉convirt

<code># /root/convirt/convirt-ctl stop</code>

<a href="http://192.168.233.170:8081/" target="_blank">http://10.10.172.194:8081</a>

輸入admin/admin

還需要在kvm虛拟主機上安裝convirt-tools工具之後才能添加。

注:在kvm虛拟主機上安裝convirt-tools工具。

<code># wget http://www.convirture.com/downloads/convirture-tools/2.1.1/convirture-tools-2.1.1.tar.gz</code>

<code># tar zxvf convirture-tools-2.1.1.tar.gz</code>

<code># cd convirture-tools/install/managed_server/scripts</code>

<code># ./convirt-tool install_dependencies</code>

<code># ./convirt-tool setup</code>

添加KVM虛拟主機。

本文轉自 dengaosky 51CTO部落格,原文連結:http://blog.51cto.com/dengaosky/2045072,如需轉載請自行聯系原作者