jenkins安装部署
一、安装jenkins
准备条件:nc主机192.168.1.7
公网:可以访问
iptables:关闭
selinux:disabled
1、下载jenkins yum源
[root@jenkins ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@jenkins ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@jenkins ~]# yum -y install jenkins
[root@jenkins ~]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins //jenkins 日志目录
2、启动jenkins,需要java环境
[root@jenkins ~]# yum -y install java
[root@jenkins ~]# systemctl start jenkins
3、查看jenkins进程
[root@jenkins ~]# ps -ef|grep jenkins
jenkins 11704 1 28 17:23 ? 00:00:22 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
root 11774 1454 0 17:24 pts/0 00:00:00 grep --color=auto jenkins
[root@jenkins ~]# netstat -antp|grep 8080
tcp6 0 0 :::8080 :::* LISTEN 11704/java
4、查看jenkins 日志,访问web ui 界面
[root@jenkins ~]# tail -f /var/log/jenkins/jenkins.log
jenkins使用的是8080端口
主机ip:8080 //浏览器访问
管理员密码
[root@jenkins jenkins]# cat /var/lib/jenkins/secrets/initialAdminPassword
092ce331da19445a8bcddd6b46a1bf85