所需积分/C币:48 2019-06-25 10:17:37 596KB PDF
收藏 收藏

3.6.1. Generating RPMS uw Lhdl we hdve the pr ereuuisi Les anld suu Ce, yuu will cd wu the packaging/centos63/rireclury s cd packaging/cent二s Generating RPMs is done using the package. sh script: 6./package. sh That will run for a bit and thEn clace the finished packages in dist/rpmbuild/RPMS/x86 64/ Yo. I should see the following RPM s in that directory cloudatack agent 1.2.0 x86∈4rpm cloudstack-awsapi-4. 2. D x8662.Em c10 unstack-c11-4.2.0.e16.x8664.-gm cloudstacl-cormoon-4. 2.0.e16x86 2.fcIm :1 rIIse.H:k-t:"-4.7.0.·16.xR664.r cloudscal-nanagemment-4.2.0.e10.385 E4 cloudatack ugagc 12.0.cl6x86 E1.rpm Creating a yum re Whilc RPms is a uscful packaging format its most casily consumed from Yum repositories over a nctwork. The next ste to create a Yum Repo with ine fnish ed packages s mkdir -p - /tmp/rero s co dist/rpmmbuild/ EPNS, xB6 64/*rpm -/tmp/repoA s createrepo /trmg, repo The files and directories winin -/tmp/ repo can now be uplcaced to a web server and serve as a yum repos tory. Configuring your systems to use your new yum repository Now that your yum repos tory is populated with RPMs and mo tadata wc nced to configure th- machines that need to instAll Cloudstack. Create a file named /etc/yum. repos. d/clouistack. repo with this in formation Capache-cloudstack] name=Apache Cloudstack baseurl=http://webservar.tld/path/to/repo bugcheck=日 Completing this step wiu allow you to easily install Cloudstack on a number of machines across the network. 注意修改文件的 baseurl值,例如fle:/root/tmp/repo Cloudstack42本地编译的调试方法 A32x/usr/share/cloudstack-management/webapps/client/WEB NF/ib/ cloud- plugin- hypervisor- baremeta|-420jar中的文件,包 括: 替换META NF/maven/org. apache cloudstack/cloud-plugin- hypervisor- baremeta/中的文件为 cloudstack/plugins/hypervisors/baremetal/pom. xml 替换com/ cloud/ baremetal/ manager/中的文件为 cloudstack/plugins/hypervisors/baremetal/src/com/cl oud/baremetal/manager/Baremetal ManagerImpljava 编译后的 Class文件。 o替换cn/ ctyun/ baremetal/deploy/中的文件为 cloudstack/plugins/hypervisors/baremetal/src/cn/cty un/ baremetal/deploy编译后的 Iclass文件。 1BEX/usr/share/cloudstack-management/webapps/client/WEB NF/ classes/ application Context. xml,内容与 loudstack/ client/tomcatconf/ application。 ntext. xml. in-致。 122X/usr/share/cloudstack-management/webapps/client/WEB NF/ classes/ commands; properties,内容与 cloudstack/client/tomcatconf/ commands. properties. in-4. 122/usr/share/cloudstack-management/setup/create schema. sql,内容与 cloudstack/ setup/db/ create- schemasq-致 ·修改| PMI/DHCP/PXE/服务器上 的/usr/ib64/loud/ agent/scripts/utl/,内容与 cloudstack/ scripts/ util/ipmi py-致。 复制 loudstack/plugins/hypervisors/baremetal/src/cn/ctyun/baremetal/ deploy/ scripts/中的脚本文件到/usr/ share/ cloudstack common/ scripts/ network/ dhcp/中。 对于第一个修改jar文件的过程,也可以直接在本地编译好jar文件,替 换服务器上的相同jar文件,具体方法是 首先,在 CloudStack项目的所有子项目中,对于 loudstack、 cloudstack- framework、 cloudstack- plugins、 cloudstack-service-console-proxy, cloudstack-service, xapi 几个子项目,分别在在 Package Explorer中选中后,右键点击改 子项目,选择 Properties-> Resource-> Resource filters,点 击Add,勾选 Exclude a、 Folders, Regular Experssion,在输 入框中输入[a-zA-z0-9].*,保存并退出。 然后,在 Package Explorer中选择所有项目,右键点击选择 Maven-> Update Project,勾选 Update project configuration from pom. xml, Refresh workspace resources from local filesystem、 Clean projects,然后确定。 待更新完成后,选择要编译的子项目 cloud- plugin hypervisor- baremeta,在Run菜单里选择Run Configurations,双击其中的 Maven build,新建一个规则,注 意勾选 Skip Tests s Eun Configurations Create, manage, and run configurations Name hardmetal type filter text E Mdin E JRE f Refteh Ey Source D EnvirurIlenL) CunT1U1l ●Ei| lipse Applitdliur Base directory a mn Python Run n Pythen unittest D: /CTCloud/Codes/apache-cloudstack-4,2.0-src/plugins/h pervisors/baremstal a Java Applet Browse Workspace.Browse File Systen. Variable.] a J Java Application u IpmiManagerTest Goals Select Ju JUnit 元 JUnit Plug-in Test Profiles F Jython run □ pdate Snapshots F Jython unttest 回 Debug Output回 p Tests回 Non-recursive g m2 Maven Build E Resolve Workspace artifacts a apl m beremetal Threads me clean Parameter name value m? utils CSGi Framework dj Py Dev Django 包 Py Dey Google App Run emorE a Python Run g Python ur ttest Maven Runtime: Embedded ( 0.4/14. J-2013051-215) Cont Filter matched m nf 20 items Apply Revert Close 最后,点击运行,在控制台窗口中可以查看编译过程,完成 后在子项目的 target目录中,会生成一个coud- plugin- hypervisor baremetal-420」jar的jar文件,直接替换/sr/ share/( cloudstack management/webapps/client/WEB-INF/ib/cloud-plugin hypervisor- baremeta420ja即可 Cloudstack日志的查看方法 动态显示,tal-f /var/log/cloudstack/management/management-server log Cloudstack通过 Eclipse远程调试的方法 ·在 Eclipse中选中要调试的工程,并在 Debug Configurations的 Remote Java Application中添加新的 Debug项目,同时在 Connection Properties的Host和Por中配置相应主机的P地址和端口号。 S Debug Configurations Create, manage, and run configurations Attach to a Jave virtual machine accepting debug connections 寓 Name: cloud-plugin-hypervisor-baremetal N Conne:t y A ∩mm∩n ● Eclipse Applicati Project: a Iron Python Run 2 Iron Python unittest oud-plugin-hyperv sor-baremetal Browse 凹 Java Applet Connection Type J Java Application Ju JUnit Standard (Sacket Attach f JUnit Plug-in Test Connection Proparties 2 Jython run Host:17218103230 Jython unittest m2 Maen buil Port 878 e OSGi Framework D Allow termination of remote VM yllev Jango 题 PyDev Goog! e App run a Python Run s Python unittest E Rernote Java Application E cloud-plugin-hypervis Filter matched 17 nf 17 items Apply Revert Debug Close 修改 Cloudstack Management Server防火墙配置,打开对应端口 号。具体方法如下; 修改 Iptables配置文件,/etc/ sysconfig/ iptables,加 X-A INPUT-p tcp -m tcp--dport 8787j ACCEPT Generated by iptables-save v1 4.7 on Thu oct 17 16: 39: 12 2013 iIter INPUT ACCEPT [234: 35916] FORWARD ACCEFT O: 0 :OUTPUT ACCEPT [233: 36096 A INPUT -p tcp -m tcp --dport 9090-1 ACCEPT A INPUT -p tcp -m tcp --dport 8250 ACCEPT A工MPUT-ptcp dport 7080 ACCEPT A INPUT -p to A工NPUT-pt p-m tcp -dport 8787 dport 8080-] ACCEPT ACCEPT A INPUT p udp -m state --state NEW -m udp --dport 111 EPT A INPUT -S 172.16. 10./24 -p tcp -m state --state NEW -m tcp --dport 111 CEPT EW -m -dport 2049 CEPT -A INPUT -5 -p tcp -m state --state NEW -m tcp--dport 32803-iACCEPT JT p udp -m state --state CEPT A INPUT 5 172.16. 10.0/24 p tcp m state statc Now m tcp dport 892 1ACCLPT A INPUT -5 172.16 10.0/24-p udp -m state --state NEW -m udp --dport 892-1 ACCEPT JT - tcp -m state --state NEW -m tcp --dport 8 CA INPUT -S 172: 16. 10: 0/24-p tcp -m state --state NEW -m tcp -dport 662 ACCEPT INPUT -5 17216.10.0/24-p udp -m state --state NEW -m udp --dport 662-jACCEPT coMMIT Comp leted on Thu oct 17 16: 39: 12 2013 o重启ⅰ tables服务, service iptables restart rootacs4 ] service iptables restart iptables: Flushing firewall rules:[OK iptables: Setting chains to policy ACCEPT: filter OK iptables: Unloading modules:[OK iptables: Applying firewall rules:[OK. 查看端口是否打开, iptables-Ln Lrootacs4 itab les -L chain InPut (policy ACCEPT) target prot opt source destination tcp dpt: 9090 ACCEPT L卩-- 0.0,0.0/0 L:8250 tcp dpt: 7080 CCEPT 080 ACCEPT t 0,0,0.0/0 tcp dpt: 8787 ACCEPT udp state NEw udp dpt: 111 CcEPT t 172,1610.0/24 state NEw tcp dpt: 111 state NEw tcp dpt: 2049 ACCEPT tcp 172,16.10 state NEw tcp dpt: 32803 CEP state NEW udp dpt: 12769 ACCEP state NEw tcp dpt: 892 ACCEPT state NEw udp dpt: 892 ACCEPT CP state New t ACCEPT - tate new udp dpt: 875 ACCEPT tcp state NEW tcp dpt: 662 CCEPT 172,16.10 state NEW udp dpt 662 Chain FORWARD (policy ACCEPT) target prot opt source destination chain oUTPUT (policy ACCEPT) target orot。 pt sour ce destination 修改 Cloud stack的 Tomcat配置文 1+,/etc/cloudstack/management/tomcat6.conf. tomcat6 ssLconftomcat6-nonssl conf 在 JAVA OPTS后加入-× debug Xrunjdwp: transport=dt socket, address=8787, server= y,suspend=n IAVAOPTS="-Djava awt headless=true -Dcom. sun, management te port=45219-Dcom sun. management emuLe. du LFlerILicdLe=dIse -DL-ml surI. lldr ldcjemerI L. imxr'em 2q一XX:+H融 ryError -XX: HeapDumpP ath=/var/lag/ cloudstack/management/ mMS-ze=512M -XX. MaxPermsize=800m -x bug -xrunddwp: tr ansport=dt_sockET, address=8787, server=,sl 重启 CloudStack Management Server, service cloudstack-management restart rootacs4-]# service cloudstack-management restart stopping cloudstack-managemel OK starting cloudstack-management: [ OK o查看 cloudstack-management服务是否启动, chkconfig --list root@cs4 ]# chkconfig 0:ff1:0f off 3. on 4.on 5: on 6:0ff auditd o:off 1: of 2.on 4.on 6:0ff clouds ack-management 0: off 1: off 2:on 3: on 4: on 5: on 6: off crond 0: off 1: off 2: on 3: on 4:on 5:on 6: off o: off off 2: an 3: on 4 on 5 on 6:0ff dnsmasq o: off off 2:on 3:on 4 on 5: on 6:0ff httpd off 2: off 3 off 4 off 5: off 6 off tabl 2:0n 3 5:o 6:0ff pried 0: off 1: off 2: off 3: off 4:off 5: off 6 off tables o: off 1:off 2: off 3 off 4 off 5: off 6 off vm2-monitor 2.on 3:on 4 on 5. on matahari-broker 0: off 2:0f13:0ff4:0ff5:of16:0ff matahari-host 0: of 3: off 4.0 matahari-network 0:oFf1:0 2: off 3: off 4: off 5:off 6: off matahari-seryice 0: off 1:off 2:off 3. off 4:off 5 off 6 off matahar i-sysconfig o: off 1: off 2: off 3: off 4:off 5:off 6: off messages 0:0ff1:0f12:0n 3:on 4on 5:n 6:0ff sald 0: off :off 2: on 3:on 4: on 5. on 6:o netconsole 0: off off 2 off 3: off 4 off 5: off 6 off netfs 0:off 1: of 2:off 3: on 4 on 5on 6:0ff network o: of 1: off 2: on 3: on on 5: on 6:off nTs 0:off 1: off 2: or 3:on on 6: off nfslock o off 1: off 2: off 3: on 6:off P 0: off 1: off 3: on 5 6:0ff ntpdate 0:off1:0ff2:0f13:0ff :0ff5:0f16:0ff portreeve 0: off f 2: on 3:on 4 on 5 on 6: off postfix 4: on on qpidd 0:off 1: off on 4 on estorecond 2. off 3: off 4 off 5: off 6 rpcbind 0. off on 4.on 6. off rpcss 0: off off 2: off 3: on 4.on 5. on 6:off rpcidmapd o: off 2:0ff 4 on 5:on 6 off pcsvcgssd 0:off 3 off 4: off 5: off 6 off 0: off 2: on 3:on 4.on 5: on 6:0ff saslauthd 0: off 1: off 2: off 3: off 4: off 5: off 6: off on 3 5:on subserve 0:off 1: off 2: off 3: off ff 5 off 6 off ttd 0: off ff 2. on 5: on 6 off u目ev-post 0: off 2:n 4:on 5: on 光盘镜像打包 命令 把 CentOs63的原版安装镜像文件挂载 o mount -o loop CentoS-6.3-x86 64-bin DVD1. iso/mnt 建立一个目录 mkdir ctcloud20 将光盘内容复制到此目录中 o cp-R/mnt/ctcloud20 o切记,要把光盘中的“ discinfo”文件拷贝过来 如果没有拷贝此文件,在用光盘安装时会提示如下错 误:“ The Centos Cd was not found in any of your CDROM drives. Please insert the CentOS CD and press ok to retry 在 ctcloud20/mnt/中加入需要的文件 0例如: ctcloud20 tar gz、 ctiptables. sh systemvmtemplate-2013-06-12-master kvm.gcow2. bz2, systemvmtemplate-2013-07-12 master- xen vhd.bz2、 kscg、 isolinux/isolinux. cfg, isolinux/splash. jpg 制作SO镜像文件 o mkisofs-o/root/ctcloud2.0-cS iso-b isolinux/isolinux bin -C isolinux/boot. cat-no emul-boot -boot-load-size 4-boot-info-table -R J-v-T/root/ctcloud20/mnt/ 主意:执行命令一定要在需要打包的这些文件的路 径下执行,也就是在 isolinux所在路径下执行命令,即 ctcloud2.0/mnt/

试读 10P CloudStack安装镜像制作方法
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
  • 分享王者

关注 私信
CloudStack安装镜像制作方法 48积分/C币 立即下载

试读结束, 可继续读1页

48积分/C币 立即下载