CloudStack 4.1.0 installation details-1. manage nodes

Source: Internet
Author: User
Tags cloudstack

CloudStack 4.1.0 installation explanation-1. The management node CloudStack is a powerful and UI-friendly open-source cloud (IaaS) computing solution. Since Ctrix donated CloudStack to apache, its community activity has gradually caught up with another open source cloud OpenStack platform.
CloudStack has the most user-friendly management interfaces for all open-source cloud platforms, and its inherent multilingual support makes Chinese users feel great. Today, we will detail how to install and deploy CloudStack 4.1.0 in CentOS 6.4. In view of the large copy of online articles, a lot of content is loaded to install a lot of things, and the readers will be dizzy soon. They do not know why these programs are installed and what they are doing. This time, I will explain each step in as much detail as possible, plus my experience and understanding (many of my experiences come after over 10 reinstalls), hoping that the future will be able to take less detours.
CloudStack can be divided into management node installation and controlled node installation. Management node installation has no special requirements and can be fully installed in a virtual machine environment.
To create virtual machines for controlled nodes, hardware virtualization is required. We recommend that you use an independent host for installation. CloudStack supports multiple virtualization solutions, including KVM, Xen, XenServer, and VMware. Because XenServer and VMware already have powerful Virtual Machine management functions, CloudStack can directly communicate with them to call their management interfaces. Therefore, there is no need to install any software in these two controlled machine environments. However, the KVM and Xen controlled machines must install CloudStack-Agent before they can be managed by CloudStack. This article describes how to set up a management node: 1. Preparations 1. Configure the NIC to ensure that the host can access the Internet, therefore, you must first ensure that your server can be connected to the Internet normally. 1. ping www. baidu. com2 and set the host name. When CloudStack is running, you must obtain the local name. If the host name cannot be obtained correctly, the Service may fail to start properly and a lot of errors may be reported. Run the following command to check: 1 hostname -- fqdn if no normal response is returned, edit the/etc/hosts file and add the name corresponding to the Host ip address. 1 For example: 2192.168.19.135 manage. cloudstack. comvi/etc/sysconfig/network. Change HOSTNAME = to the same as you just set. It takes effect immediately after editing. If not, restart the server. 3. configuring the time synchronization management node will communicate with the controlled node through various protocols. To ensure security, the controlled node will perform a series of verification after receiving the command. If the time of the two machines is not synchronized, command Execution is denied. The simplest way is to install ntp on all servers for automatic synchronization. 1yum install ntp4. Modifying SELinux on the Linux Security Settings server intercepts some CloudStack commands, causing the CloudStack operation to fail. Therefore, you need to set SELinux before starting CloudStack. Vi/etc/selinux/config1SELINUX = permissive the above changes must be restarted to take effect. To make the settings take effect immediately, use the following command 1 setenforce permissive 2. Update the yum repository by default, the latest version of CloudStack is not included in the CentOS software source. To ensure smooth installation, We need to manually specify the software source. Create the/etc/yum. repos. d/cloudstack. repo file. The content is: 1 [cloudstack] 2 name = cloudstack3baseurl = policyum, which is very simple and convenient. Run the following command to install the management node: 1yum install cloud-client. If your CentOS installation is minimal, you will need to install something above 160 mb. Please wait... 4. Configure the database CloudStack to use mysql to manage data, but the cloud-client does not contain mysql. In this case, we need to manually install and import data. This is understandable, because the database can be installed on other machines. 1yum install mysql-server by default. mysql has a limit on the number of connections, which cannot meet the requirements of CloudStack Management Nodes and must be set manually. Vi/etc/my. cnf added the following content: 1innodb_rollback_on_timeout = 12innodb_lock_wait_timeout = 6003max_connections = 3504log-bin = mysql-bin5binlog-format = 'row' Note: If not modified, what will happen I did not try, but it is recommended to modify as required. The max_connections parameter should be set to 350 multiplied by the number of management nodes you are about to deploy. Only one management node is installed. Now, start mysql service: 1 service mysqld start the default installed mysql security level is relatively low, you need to manually set the mysql password, disable remote access, delete useless accounts and test the database. The method is also very simple. Use the following command to follow the wizard prompts step by step: After the 1mysql_secure_installation database is ready, you need to import the table and basic data of CloudStack so that the cloud platform can use: 1cloudstack-setup-databases cloud normally: 123456 @ localhost -- deploy-as = root: If the set root password is not unexpected, the words "CloudStack has successfully initialized database" will be output, indicating that the database is ready. 5. login to the WEB-UI so far, although there is still a lot of work to do, but now you can actually log on to the CloudStack console. Start the CloudStack service first: 1 server cloudstack-management restart it takes some time to start the CloudStack service. During this period, you can view its logs to ensure that it starts properly: 1 tail-100f/var/log/cloudstack/management/catalina. in general, it starts normally. If a permission error is reported during startup, it is generally because the cloud user does not have the/var/log/cloudstack/management/write permission. 1 chown cloud/var/log/cloudstack/-R after successful startup, you can now access the management node using Google or Firefox: http: // management node ip: 8080/client Note: There may be compatibility issues with IE access. Cloudstack provides web Services Based on tomcat. port 8080 is used by default. If you want to use another port, you can modify the/etc/tomcat6/server. xml file for configuration. Cloudstack is installed in the/etc/cloudstack/management directory by default. You can adjust the log output level and path by modifying the log4j-cloud.xml file. CloudStack native supports Chinese characters. How can this problem be solved? The default user name is admin and the password is password. The Wizard Page is displayed when you log on to the console for the first time. At present, our preparations have not been completed and cannot be correctly added. Therefore, skip this step first. After logging in, click "Infrastructure". All CloudStack resource management functions are under "Infrastructure. The "region" can be understood as an equipment room; the "provisioning point" can be understood as a rack; the "cluster" is the group management of hosts in the rack; and the "primary storage" is network storage, it is mainly used to store Virtual Machine hard disks. Of course, you can also use local storage. "level-2 Storage" is also used for network storage, which is mainly used to store Virtual Machine templates and snapshots. "System VM" is a dedicated virtual machine that comes with CloudStack to Manage Level 2 Storage and remote terminals. The second-level storage VM must enable the template and other functions. After the remote terminal VM is started normally, you can directly access the VM console on the WEB page. The "virtual router" is also a dedicated virtual machine that comes with CloudStack. It is mainly used for network functions such as network isolation and port forwarding. According to the above introduction, to add a new "region", you must also rely on the support of network storage and system virtual machines. Therefore, you must continue to work hard. 6. Install the primary network storage because you can use local storage, you can not add it, but the secondary storage can only use network storage. CloudStack supports multiple network storage protocols, such as iSCSI, NFS, and VMFS. Because NFS is easy to use, we recommend that you use NFS to set up network storage. Install NFS: 1yum install nfs-utils edit the/etc/export file and set the path of the Primary and Secondary storage # vi/etc/exports in the file, add the following content: 1/export * (rw, async, no_root_squash) create the actual folder 1 mkdir-p/export/secondary2mkdir-p/export/primary and modify/etc/sysconfig/nfs to open all the port numbers in the folder 1LOCKD_TCPPORT = 328032LOCKD_UDPPORT = bytes = 8755STATD_PORT 6626STATD_OUTGOING_PORT = 2020 then open the iptables Port: vi/etc/sysconfig/iptables01-A INPUT-p tcp-m tcp -- dp Ort 111-j ACCEPT02-A INPUT-p udp-m udp -- dport 111-j ACCEPT03-A INPUT-p tcp-m tcp -- dport 2049-j ACCEPT04-A INPUT-p tcp-m tcp -- dport 32803-j ACCEPT05-A INPUT-p udp-m udp -- dport 32769-j ACCEPT06-A INPUT-p tcp-m tcp -- dport 892-j ACCEPT07-A INPUT-p udp-m udp -- dport 892 -j ACCEPT08-A INPUT-p tcp-m tcp -- dport 875-j ACCEPT09-A INPUT-p udp-m udp -- dport 875-j ACCEPT10-A INPUT -P tcp-m tcp -- dport 662-j ACCEPT11-A INPUT-p udp-m udp -- dport 662-j ACCEPTservice iptables restart start NFS service: 1 service nfs start2service rpcbind start set the service to automatically restart 1 chkconfig nfs on2chkconfig rpcbind onCloudStack has a global attribute to control the network segment of the secondary storage. If this CIDR block is not configured or is incorrectly configured, it may fail to be added to Level 2 storage. Log onto the CloudStack Management page, select "global settings", and enter sites search in the search box on the top right. Modify secstorage. allowed. internal. sites is the current network segment of level-2 storage. For example, search for local in 192.168.0.0/24 and modify system. vm. use. local. storage is true, which allows the system VM to use local storage. After modification, restart CloudStack to take effect. 1. server cloudstack-management restart 7. Import System Virtual Machine template system virtual machine plays an important role in CloudStack. If the system virtual machine is not correctly imported, CloudStack cannot manage Level 2 storage, you cannot import templates or create new virtual machines. The system VM file is large and is not included in the CloudStack Installer. You need to download and import it manually. Because the system VM needs to be stored in Level 2 storage, you must first mount Level 2 storage to the local hard disk 1 mkdir/tmp/iso-p2mount-t nfs 127.0.0.1: /export/secondary/tmp/iso3cd/usr/share/cloudstack-common/scripts/storage/secondary/different virtual machine implementation schemes system VM templates are also different if your controlled machine uses KVM, use the following command: 1. /cloud-install-sys-tmplt-m/tmp/iso/-u http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2-h kvm-F if your controlled machine uses XenServer, use the following command: 1. /cloud-install-sys-tmplt-m/tmp/iso/ -U http://download.cloud.com/templates/acton/acton-systemvm-02062012.vhd.bz2-h xenserver-F if your controlled machine uses vCenter, use the following command: 1. /cloud-install-sys-tmplt-m/tmp/iso/-u http://download.cloud.com/templates/burbank/burbank-systemvm-08012012.ova-h vmware-F file is large, please be patient. ...... Of course, you can also download the file to your local computer and then import it using the-f parameter. Example: 1. /cloud-install-sys-tmplt-m/tmp/iso/-f/var/acton-systemvm-02062012.qcow2.bz2-h kvm-F 8. Add "Infrastructure, now all preparations for the CloudStack management node have been completed. Next, you can add your first "region. In this step, CloudStack provides a friendly Wizard to help you complete the addition correctly. In addition, there are a lot of articles on the Internet that I will not elaborate on. I will introduce the functions and adding methods of CloudStack advanced network domains when I have the opportunity in the future. Appendix, possible problems: 1. The webui of the management node cannot be accessed. Check whether iptables blocks port 8080. Check whether the cloudstack-management Service is properly started. 1 server cloudstack-management status if the startup status is abnormal, check the log. The log is located in/var/log/cloudstack/management/catalina. out. According to the error prompts in the log, most problems can be solved. If the log information is not detailed enough, you can modify/etc/cloudstack/management/log4j-cloud.xml to adjust the log output level. 2. The system prompts that the user name and password are incorrect during login. The default logon username is admin and password is password. If the error message is incorrect during login, it may be a problem when importing the basic database. Re-import the basic database: 1cloudstack-setup-databases cloud: 123456 @ localhost -- deploy-as = root: If the root password does not work, refer to 5. Delete the database and re-import it. 3. CloudStack cannot add primary or secondary storage. Check whether the/etc/sysconfig/nfs configuration file opens the ports. Check whether iptables is blocked. Check whether the "global settings" and secstorage. allowed. internal. sites attributes of CloudStack are correctly set. 4. CloudStack cannot import IOS or virtual machine templates. After creating an "Infrastructure", you can import ISO files or virtual machine templates to prepare for creating virtual machines. If you find that when you register an ISO or registration template, the Status field remains unchanged and is always no when you are ready, it is generally because of problems with Level 2 Storage or Secondary Storage VM. Select "Control Panel"> system capacity to check whether the second-level storage capacity is correct. Check whether the Secondary Storage vm in the system vm is properly started. 5. How to reinstall and install CloudStack? After CloudStack is installed, we often conduct various experiments, which may make the system messy. It is very troublesome to delete them because they often have hierarchical relationships and must be deleted from the bottom layer. Is there a simple way to reverse it? The answer is yes. You only need to reset the database. Stop the CloudStack service first: service cloudstack-management stop log on to the mysql console and delete the database: mysql-u root-p1drop database cloud; 2 drop database cloud_usage; 3 drop database cloudbridge; 4 quit; re-import basic data: 1cloudstack-setup-databases cloud: 123456 @ localhost -- deploy-as = root: root Password re-import system VM: 1 mount-t nfs 127.0.0.1: /export/secondary/tmp/iso2rm-rf/tmp/iso/3cd/usr/share/cloudstack-common/scripts/storage/secondary/refer to section 7th, import the corresponding system VM template. Restart cloudstack service 1 service cloudstack-management start. Then, you can log on to a new CloudStack. 6. The regions and endpoints of CloudStack cannot be named in Chinese. In versions earlier than 4.1, regions and endpoints can be named in Chinese, however, in version 4.1, I do not know why it is so restrictive. If you care about this function, use a version earlier than 4.1. 4.0.2 is recommended.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.