jenkins安装与使用
安装
问题
- Java环境安装
Install Oracle Java 8 on Ubuntu via PPA
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install java-common oracle-java8-installer
java -version
javac -version
slave也需要安装同样的java8环境
连接不上slave机器
使用vagrant用户登录master,配置private key,ssh-copy-id 到slave机器,之后
在master部署的jenkins平台 配置slave节点时,出现如下问题
No Known Hosts file was found at /var/lib/jenkins/.ssh/known_hosts. Please ensure one is created at this path and that Jenkins can read it.
处理办法:
- 用vagrant登录master机器
- ssh 'vagrant@192.168.2.3'登录slave机器
- 此时会在/home/vagrant/.ssh/目录下产生known_hosts文件
- 讲known_hosts文件cp到/var/lib/jenkins/.ssh/目录下