cloudsim--ubuntu下,下载和安装cloudsim

CloudSim是在离散事件模拟包SimJava上开发的函数库,所以在进入安装cloudsim之前应当配置你的计算机的java开发环境

1 安装JDK

http://java.sun.com/ 下载JDK最新版本,病、并“计算机-高级-环境变量”进行环境变量的设置 ,完成之后,在终端中 输入:“java -version” 进行检测JDK是否安装成功

 2 安装配置cloudsim 

进入 墨尔本大学云计算实验室http://www.gridbus.org/cloudsim/网站,

http://code.google.com/p/cloudsim/downloads/ 

再通过该网页中提供的链接进行cloudsim的下载(当前下载的最新版本是cloudsim.3.0.3)source

3  tar -vxf XXX.tar.gz 对下载的压缩包进行解压 
以cloudsim-3.0.3为例 简要介绍目录结构 

/doc 是帮助文档,通过点击index.html 可以在浏览器中查看该库的API说明
/sources是该库的源代码
/ jar 是源码和例子examples程序jar包 
/examples 目录下就是例子程序
在/ cloudsim/examples/org/cloudbus/cloudsim/examples目录下有CloudSimExampleX.java(x:1~8)8个例子程序 ,例子的作用是什么在根目录下的readme.txt中有详细说明

4  编译运行例子程序 (在ubuntu下)
1. cd <PATH TO CLOUDSIM PACKAGE>   # 进入解压包的跟牡蛎
2. sudo javac -classpath jars/cloudsim-<VERSION>.jar:examples examples/org/cloudbus/cloudsim/examples/CloudSimExample1.java  # VERSION版本号3.0.3
3.  sudo java -classpath jars/cloudsim-<VERSION>.jar:examples org.cloudbus.cloudsim.examples.CloudSimExample1

5 运行结果 
Starting CloudSimExample1...
Initialising...
Starting CloudSim version 3.0
Datacenter_0 is starting...
Broker is starting...
Entities started.
0.0: Broker: Cloud Resource List received with 1 resource(s)
0.0: Broker: Trying to Create VM #0 in Datacenter_0
0.1: Broker: VM #0 has been created in Datacenter #2, Host #0
0.1: Broker: Sending cloudlet 0 to VM #0
400.1: Broker: Cloudlet 0 received
400.1: Broker: All Cloudlets executed. Finishing...
400.1: Broker: Destroying VM #0
Broker is shutting down...
Simulation: No more future events
CloudInformationService: Notify all CloudSim entities for shutting down.
Datacenter_0 is shutting down...




你可能感兴趣的:(linux,CloudSim)