The article to Taobao, for example the evolution of electronic business, from personal websites to find java website and distributed. To do the service of the application, the database used to read and write separate sub-library sub-table, redis cluster, oss picture processing.
Today to talk about how landing.
Source: https://github.com/limingios/netFuture/tree/master/jenkins+nexus+gogs
(A) set up a virtual machine
- Create a virtual machine
By generating four source virtual machine, ready to work. vagrant corresponding docker already installed. Installation nexus is to avoid an environment variable, and the like complicated operations empower users with docker. For vagrant can see how to install the system is not the same without
mac installation vgarant: https://idig8.com/2018/07/29/docker-zhongji-07/
window installation vgaranthttps: //idig8.com/2018/07/ 29 / docker-zhongji-08 /
System Type | IP addresses | Node Role | CPU | Memory | Hostname |
---|---|---|---|---|---|
Centos7 | 192.168.72.101 | SI-gogs | 2 | 3G | SI-gogs |
Centos7 | 192.168.72.102 | SI-jenkins | 2 | 3G | SI-jenkins |
Centos7 | 192.168.72.103 | SI-nexus | 2 | 3G | SI-nexus |
Centos7 | 192.168.72.104 | SI-tomcat | 2 | 2G | SI-tomcat |
(B) environment to build
Which involves the installation of many ways to simplify the use docker I have done, it can not be simplified quite satisfactory in the normal way up the installation.
- 1.docker installation Gogs (72.101)
Switching the root user
su -
#密码 vagrant
From the image taken Kula
docker pull gogs/gogs
Create the appropriate folder
mkdir -p /var/gogs
Create a docker container gogs, turn off the firewall
docker run -t --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
# 关闭防火墙
service iptables stop
# 查看是否关闭
firewall-cmd --state
WARNING: IPv4 forwarding is disabled Networking will not work..
A virtual machine can not access the external port forwarding.
Solution: When you start docker web service [virtual machine can not access the external port forwarding]
vi /etc/sysctl.conf
#添加,按键ESC,wq保存
net.ipv4.ip_forward=1
#重启网络
systemctl restart network
#查看是否修改成功
sysctl net.ipv4.ip_forward
Access gogs re-configuration page
192.168.72.101
How to configure gogs
IP Do not use localhost, responsible for external container can not access the
Installed
Creating a warehouse test
Modify the file submitted to the test and found that is not the problem. It seems gogs is now installed.
Username: liming
Password: 123456
- 2. Install Jenkins (72.102) is not recommended docker installation
Container mounting jdk, maven, git the like, the more need to mount, while dockerfile complex. According to my shell a key installation.
Source: jenkins + nexus + gogs / jenkins.sh
Official website: https://jenkins.io/zh
Switching the root user
su -
#密码 vagrant
View shell script
Edit Script
source /etc/profile
cd /root/
vi jenkins.sh
Empowering script, running script
#shell脚本里面设置了端口8888,喜好自行修改
chmod 777 jenkins.sh
sh jenkins.sh
The installation is complete
View first installation keys
cd /root
ls
#末尾可以看到秘钥
cat nobup.out
Web install jenkins, is above the keys copied
Select the plug-in installation
pipline plug-ins have been installed, if the installation is docker jenkins, plug the old installation fails
Use admin login, password or just cat nobup.out the password
to change the password, the password change to 123456
Username: admin
Password: 123456
# 如果虚拟机重启的话,需要输入这个命令才可以启动jenkins
cd /root
nohup java -jar jenkins.war --ajp13Port=-1 --httpPort=8888 &
- 3.docker install Nexus (72.103)
Switching the root user
su -
#密码 vagrant
From the image taken Kula
docker pull sonatype/nexus3
Create the appropriate folder
mkdir /var/nexus-data
#权限问题
chown -R 200 /var/nexus-data
Create a docker container nexus, turn off the firewall
docker run -d -p 8081:8081 --name nexus -v /var/nexus-data:/nexus-data sonatype/nexus3
# 关闭防火墙
service iptables stop
# 查看是否关闭
firewall-cmd --state
View Status
docker ps -a
Installed
Username: admin
Password: admin123
PS: docker mounted gogs and nexus. Installation jenkins normal way. Under section reviews sustained release management under tomcat on 104.