在ubuntu上创建分布式jenkins项目
2015-11-12 11:08
489 查看
1、环境安装
(1)JDK安装:sudo apt-get install openjdk-7-jdk
(2)maven2安装:sudo apt-get install maven2
注:maven安装好之后 ,要注意在特殊情况下替换成自己的settings.xml。位置在/etc/maven2/settings.xml
(3)ssh安装:sudo apt-get install openssh-client(系统默认应该是安装好的)
sudo apt-get install openssh-server
(4)在master节点上安装jenkins服务(以ubuntu为例)
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get update
sudo apt-get install jenkins
启动web管理页面:http://localhost:8080
2、在jenkins上创建节点,如下图
3、将slave连接到master,通过ssh连接,在master执行以下命令
zhaozh@ubuntu:~$ssh
zzh@172.21.101.130
zzh@172.21.101.130'spassword:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux3.13.0-32-generic x86_64)
*Documentation: https://help.ubuntu.com/
522 packages can be updated.
239 updates are security updates.
Last login: Wed Nov 11 17:44:04 2015 from172.21.101.132
zzh@ubuntu:~$wget
http://72.21.101.132:8080/jnlpJars/slave.jar
--2015-11-11 17:48:01-- http://172.21.101.132:8080/jnlpJars/slave.jar
Connecting to 172.21.101.132:8080...connected.
HTTP request sent, awaiting response... 200OK
Length: 489023 (478K)[application/java-archive]
Saving to: ‘slave.jar’
100%[======================================>]489,023
--.-K/s in 0.01s
2015-11-11 17:48:01 (37.4 MB/s) -‘slave.jar’ saved [489023/489023]
zzh@ubuntu:~$java -jar slave.jar -jnlpUrlhttp://172.21.101.132:8080/computer/DBServerNode/slave-agent.jnlp
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: CoinServerNode
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headlessmode.
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among[http://localhost:8080/, http://172.21.101.132:8080/]
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to 172.21.101.132:34626
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP2-connect
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
4、创建maven2工程,如下图
5、执行,build now即可完成
(1)JDK安装:sudo apt-get install openjdk-7-jdk
(2)maven2安装:sudo apt-get install maven2
注:maven安装好之后 ,要注意在特殊情况下替换成自己的settings.xml。位置在/etc/maven2/settings.xml
(3)ssh安装:sudo apt-get install openssh-client(系统默认应该是安装好的)
sudo apt-get install openssh-server
(4)在master节点上安装jenkins服务(以ubuntu为例)
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get update
sudo apt-get install jenkins
启动web管理页面:http://localhost:8080
2、在jenkins上创建节点,如下图
3、将slave连接到master,通过ssh连接,在master执行以下命令
zhaozh@ubuntu:~$ssh
zzh@172.21.101.130
zzh@172.21.101.130'spassword:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux3.13.0-32-generic x86_64)
*Documentation: https://help.ubuntu.com/
522 packages can be updated.
239 updates are security updates.
Last login: Wed Nov 11 17:44:04 2015 from172.21.101.132
zzh@ubuntu:~$wget
http://72.21.101.132:8080/jnlpJars/slave.jar
--2015-11-11 17:48:01-- http://172.21.101.132:8080/jnlpJars/slave.jar
Connecting to 172.21.101.132:8080...connected.
HTTP request sent, awaiting response... 200OK
Length: 489023 (478K)[application/java-archive]
Saving to: ‘slave.jar’
100%[======================================>]489,023
--.-K/s in 0.01s
2015-11-11 17:48:01 (37.4 MB/s) -‘slave.jar’ saved [489023/489023]
zzh@ubuntu:~$java -jar slave.jar -jnlpUrlhttp://172.21.101.132:8080/computer/DBServerNode/slave-agent.jnlp
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: CoinServerNode
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headlessmode.
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among[http://localhost:8080/, http://172.21.101.132:8080/]
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to 172.21.101.132:34626
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP2-connect
Nov 11, 2015 5:48:12 PMhudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
4、创建maven2工程,如下图
5、执行,build now即可完成
相关文章推荐
- 关于Jenkins在Linux快速搭建持续集成环境
- jenkins------结合maven将svn项目自动部署到tomcat下
- jenkins------部署项目到jboss eap下
- Jenkins实战演练之Windows服务器快速搭建
- Jenkins实战演练之Linux服务器快速搭建
- Jenkins实战演练之安全管理
- Jenkins实战演练之Windows系统节点管理
- Jenkins实战演练之Linux系统节点管理
- Jenkins实战演练之Windows节点任务配置
- Jenkins实战演练之Linux节点任务配置
- 简析Jenkins专有用户数据库加密算法
- 每日备份JENKINS_HOME至SVN
- 使用docker构建jenkins镜像并运行容器
- 使用jenkins进行git多分支项目打包时的一个小问题
- jenkins动态参数构建
- Jenkins环境搭建(Linux Master & Windows Slave)
- Jenkins
- 后台系统团队的那些研发经理们
- 基于Jenkins + Tomcat 的安卓客户端可持续化构建及发布下载(loltube.cn)
- jenkins持续构建环境搭建