本帖最后由 pig2 于 2016-5-1 21:50 编辑
第一步:软件包的下载
[mw_shl_code=html,false]apache-tomcat-7.0.69.tar.gz 下载URL:
http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.69/bin/
apache-maven-3.2.5-bin.tar.gz下载URL:
http://mirror.bit.edu.cn/apache//maven/maven-3/3.2.5/binaries/
zeus2-master.zip下载URL:
https://github.com/michael8335/zeus2
[/mw_shl_code]
第二步:解压和环境变量配置
1.将apache tomcat,maven软件包上传到/root/soft/apache/
zeus2 上传到/root/soft (如果没有这两个路径可执行创建)
并进入软件包目录下解压
[mw_shl_code=shell,false]tar -zxvf apache-tomcat-7.0.69.tar.gz
tar -zxvf apache-maven-3.2.5-bin.tar.gz
unzip zeus2-master.zip[/mw_shl_code]
2.配置maven
vi /etc/profile 在里面新增maven的home目录,并将它的bin加入到path后面 [mw_shl_code=shell,false]MAVEN_HOME=/root/soft/apache/apache-maven-3.2.5
exportPATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
cd /root/soft/apache/
mkdir mvn_repo 资源库存放文件夹
cd /root/soft/apache/apache-maven-3.2.5/conf[/mw_shl_code]
编辑settings.xml
将里面对应的localRepository 标签注释去掉,修改内容为:
[mw_shl_code=xml,false]<localRepository>/root/soft/apache/mvn_repo</localRepository>[/mw_shl_code]
第三步:配置Zeus
1. [mw_shl_code=shell,false]vi /root/soft/zeus2-master/web/src/main/filter/antx.properties[/mw_shl_code]
[mw_shl_code=xml,false]#环境配置,用来标记环境,可以配合Environment使用
zeus.env=test-env
zeus.loggingRoot=/root/soft/zeuslog
zeus.loggingLevel=warn
#任务执行文件夹,每次任务都会在此文件夹下新建一个临时文件夹
zeus.localdata.dir=/root/soft/run_job_dir
#此处必须是hdfs路径,所有的上传附件都会存放在下面路径上
zeus.hdfsLibPath=/hdfs-upload-dir
#环境配置,如果是在一个集群中,需要配置城同一个名称
zeus.schedule.group=test-env
#Scheduler 与 Worker 通信的端口
zeus.connect.port=9887
#hadoop jobtracker地址,填写ip+port 或者domain+port
zeus.jobtracker=127.0.0.1:50030
#zk配置非必选,可以为空,此处的zk是用来通知任务的成功失败事件的
zeus.zookeeper.host=[/mw_shl_code]
2.拷贝antx.properties 到用户home目录下 [mw_shl_code=shell,false]cp antx.properties ~/[/mw_shl_code]
3.设置/root/soft/zeus2-master/web/pom.xml修改相应的highcharts-1.4.0.jar 路径
[mw_shl_code=xml,false]<local.highcharts>/root/soft/zeus2-master/web/libs/highcharts-1.4.0.jar</local.highcharts>[/mw_shl_code]
4.mysql中创建zeus数据库
mysql> create database zeus;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hive |
| mysql |
| test |
| zeus |
+--------------------+
5 rows in set (0.02 sec)
配置zeus数据库连接
/root/soft/zeus2-master/web/src/main/resources/persistence.xml
[mw_shl_code=xml,false]<bean id="dataSource"class="org.apache.commons.dbcp.BasicDataSource"> <propertyname="driverClassName" value="com.mysql.jdbc.Driver"/>
<propertyname="url" value="jdbc:mysql://master:3306/zeus2?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&autoReconnectForPools=true"/>
<propertyname="username" value="root"/>
<propertyname="password" value="123456"/>
<propertyname="maxActive" value="20" />
<propertyname="initialSize" value="3" />
<propertyname="maxWait" value="60000" />
<propertyname="maxIdle" value="15" />
<propertyname="minIdle" value="5" />
<propertyname="removeAbandoned" value="true" /> <propertyname="removeAbandonedTimeout" value="180" />
<property name="validationQuery" value="SELECT 1"/>
<property name="testOnBorrow" value="true" />
</bean>[/mw_shl_code]
5.配置hadoop home和hive home
[mw_shl_code=shell,false]HADOOP_HOME=/opt/cloudera/parcels/CDH/lib/hadoop
HIVE_HOME=/opt/cloudera/parcels/CDH/lib/hive
export HADOOP_HOME HIVE_HOME[/mw_shl_code]
安装dos2unix
[mw_shl_code=shell,false]yum install -y dos2unix[/mw_shl_code]
6.打包zeus
进入zeus根目录顺序执行以下命令
[mw_shl_code=shell,false]mvn clean:clean
mvn package -Dmaven.test.skip=true
cd deploy
mvn assembly:assembly[/mw_shl_code]
7.把war发布到tomcat
构建出的war包在/deploy/target/zeus.war处 复制到tomat/webapps 目录下
重启tomcat
http://192.168.1.100:8080/zeus
|