"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

This time I have come to the last stop of the software, haha, that is, the software is released and deployed to the server. In fact, in the process of deployment, especially the prevalence of microservice architecture, the software itself likes to use what agile development, the difficulty of continuous release is also quite large, it turns out that no matter how the project is organized, as long as the project is finally deployed, it can be accessed normally The project is deployed. But once the project is dismantled and many services are dismantled, it is really not a simple thing to deploy at this time. You need to use scientific methods and experience to get this done.

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Problems faced by large-scale system release

Especially now many leaders like agile development, and agile development leads to a function that would have been developed in a week. He tells you 2 days. Why does it take 2 days? Agile development is fast. Agile development itself is problematic.

  • How many companies publish now. How often do you post.

    Several situations around

1. Pack it by yourself and release it directly after telling the leader. When the leader said it will be released.
2. Tell the operation and maintenance personnel the location of the project git, notify the operation and maintenance to go online, and release it to the production environment. (If there are hundreds or dozens of projects, tell the operation and maintenance, how large a team is required for operation and maintenance)
3. There are small updates every day, and they are released every day.
4. The project release uses the jenkins tool, which is used to automate the build and release.

  • Talk about the problems that exist in the releases around
    1. There is no problem, and the parameters are wrong.
    2. The dependent project has not been released, and I released it first
    3. The dependent version of the project itself is not released this time, and the result is that its own project depends on the function of that project
    4. The operation and maintenance personnel release the code of the test environment to the production environment

  • Accidents caused by rollbacks

    Rollback is generally difficult to do. If it’s only at the code level, it’s okay to just backup and roll back to the last time. If it involves refreshing the database, is it embarrassing? The new version of the data has been refreshed, but the code Rolled back, do you want to refresh the data back to the unwashed state? Maybe there are scripts you have brushed in the past, but the scripts you brushed back may not be. This is the accident.

To dismantle a project, especially large-scale projects, large-scale Internet projects are scattered, dozens of hundreds, and those projects are scattered, they still have project dependencies before, they really release it. It’s a very difficult thing.

  • Software release is actually a very, very difficult thing. It tests the level of management personnel, how to control the overall situation, and how to execute them in sequence.

    With the prevalence of agile development models and microservices, software integration becomes more difficult and continuous deployment becomes difficult. How to reduce the accidents caused by release, shorten the interaction cycle, and achieve sustainable deployment! In fact, this is also a world problem. It is too difficult. You can only set it according to your own business, not the latest and the best, but the most suitable one.

  • Software development phase

    The correct stage of software development: Coding> Build> Integration> Testing> Delivery> Deployment
    Sustainable Integration> Sustainable Deployment> Sustainable Release

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

  • Continuous Integration (INTEGRATE)

    Integration: If it is a single development, there is no integration. All functions are in one project, and they have been integrated in the software development process, which is equivalent to being integrated. It is becoming more and more popular that a function is not developed by a project, such as a trading center during Double 11, when submitting shopping information, it may rely on the inventory center, product center, payment center, member center, and notification center. The development of the function of submitting orders relied on a lot of systems later, and adding the small bug of modifying the order submission may affect more than N projects that need to be modified. It is very likely that you deploy the order submission project, and multiple other projects need to be deployed simultaneously.

Official explanation: The personal R&D part of the software is delivered to the whole part of the software, and frequent integration is carried out to find the errors faster.

  • Continuous interaction (DELIVER)

    Interaction: Similar to the online rehearsal environment, it is sometimes called a grayscale environment. When we test it, we also need to go through the rehearsal environment first. Some functional requirements are not so strict and may be directly tested without the rehearsal environment. More The company may deploy directly after building.

Official explanation: On the basis of continuous integration, deploy the integrated code to be closer to the real operating environment

  • Continuous integration, the biggest problem facing continuous interaction

    The problem of coordination and writing
    depends on the package, and the dependent projects are agreed to be launched together at the same time, but if you don’t know the reason, it will drop the chain. Your own project cannot be released as scheduled, but your own project may rely on another function The interface that may be required causes other interfaces to fail to be released, and a chain is formed, one function cannot be as expected, and all others cannot be as expected. All collapsed.

1. The biggest problem is coordination and collaboration.
2. If it is agreed at the time, whether to consider emergency plans, inform in advance that it cannot be provided,

  • A smooth and sustainable integration requires the following points:
    1. A clear and executable release process
    2. A release management coordinator who is familiar with the process (this kind of person must be good at multithreading issues)
    3. Effective communication and Feedback mechanism (confluence for information feedback)
    4. Sustainability integration tools (jenkins)
    5. Version management tools (not just code management tools, daily program files SVN)

Environment required for version release process (confluence, SVN)

  • Information coordination tool (confluence)
    1. Monthly release plan (roughly rough)
    2. Weekly release plan (product manager, submit this daily release function)
    3. Testers submit specific release window plan documents (developers write this time themselves Responsible system, dependencies and script checklist can be modified at a certain time before going
    online , and documents can be written together) 4. Online incident report (bug repair plan)

  • Version management tools (release files, not code level)

    git (git steps are cumbersome, need add, commit, push)
    nexus
    ftp (shared files) the easiest way.
    svn

  • confluence

    Introduction: Confluence is a professional enterprise knowledge management and collaboration software, which can also be used to build enterprise wikis. Simple to use, but its powerful editing and site management features can help team members share information, document collaboration, group discussions, and push information. It can also be used as a team collaboration software within the company to edit word, execel, ppt, etc. online. This function is similar to Tencent's online word editing, execel. But it is more powerful.
    Source code: https://github.com/limingios/netFuture/tree/master/confluence

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Official website: https://www.atlassian.com/software/confluence/download-archives It is
not recommended to use the latest, the software itself is charged, I suggest you download 5.6.6, why, because it can be cracked

Environment preparation
1. CentOS 7 2.java
jdk 1.8
3.mysql-server 5.6
4.confluence 6.9.1

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

  • Service Information

    Generate virtual machine through vagrant

System type IP address Node role CPU Memory Hostname
Centos7 192.168.68.100 confluence 2 4G confluence
vagrant up
su -
#密码 vagrant
vi /etc/resolv.conf
#nameserver 8.8.8.8
reboot
  • jdk installation

    Jdk8 must be installed

wget wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"
#上边的下载比较慢,建议不通过wget的方式,本地下载后上传上去,我下载了3个多小时,当时正好想看电视剧看了几集
tar -zxvf jdk*
cd jdk*
#获取jdk目录填写到下面JAVA_HOME中
pwd
#追加环境变量
echo "export JAVA_HOME=/root/jdk1.8.0_141" >> /etc/profile
echo "export PATH=$""JAVA_HOME/bin:$""PATH" >> /etc/profile
#执行下面这个才能生效
source /etc/profile
java -version
javac -version

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

  • mysql installation
#下载mysql 源
wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
#安装mysql 源
yum -y install mysql57-community-release-el7-11.noarch.rpm
#安装mysql,中间会弹出是与否的选择,选择y即可,然后耐心等待吧。。。。。。。
yum  install mysql-community-server
#启动mysql
systemctl start  mysqld.service
#查看mysql状态
systemctl status mysqld.service
#查看初始密码
grep "password" /var/log/mysqld.log
#登录
mysql -uroot -p
#输入刚才查看的初始密码

#修改密码:我这里修改成:1qaz@WSX
ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@WSX';

#授权远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1qaz@WSX' WITH GRANT OPTION;

#刷新上边操作,就是提交操作
FLUSH PRIVILEGES;
#退出mysql控制台
exit

#设置自动启动
systemctl enable mysqld
systemctl daemon-reload

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Confluence can use the embedded database, but as a production environment, confluence is recommended to use its own database.
When installing the database, it supports a variety of databases. I use mysql here. Both versions 5.6/5.7 can. There is also a jar package mysql-connector that needs to connect to mysql.

The first is the configuration file /etc/my.cnf, add it under the [mysqld] tag

vi /etc/my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=2GB
sql_mode = NO_AUTO_VALUE_ON_ZERO
transaction-isolation=READ-COMMITTED
binlog_format=row

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Finally, restart mysqld and log in to mysqld to view the character set. The password set when creating the database is: 1qaz@WSX

service mysqld restart
mysql -uroot -p
mysqld [(none)]> show variables like "%character%";show variables like "%collation%";

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Create the corresponding database, username and password for Confluence

create database confluence default character set utf8 collate utf8_bin;
grant all on confluence.* to 'root'@'%' identified by '1qaz@WSX';
flush privileges;
  • Install Confluence
# 下载安装程序
wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.9.1-x64.bin
# 授权安装程序执行权限
chmod a+x atlassian-confluence-6.9.1-x64.bin
# 执行安装程序,进行安装:

./atlassian-confluence-6.9.1-x64.bin
[root@confluence ~]# chmod a+x atlassian-confluence-6.9.1-x64.bin
[root@confluence ~]# ./atlassian-confluence-6.9.1-x64.bin
Unpacking JRE ...
Starting Installer ...

This will install Confluence 6.9.1 on your computer.
OK [o, Enter], Cancel [c]
#选择确定安装
o
Click Next to continue, or Cancel to exit Setup.

Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (uses default settings) [1], 
Custom Install (recommended for advanced users) [2, Enter], 
Upgrade an existing Confluence installation [3]
#目录选择自定义
2

Select the folder where you would like Confluence 6.9.1 to be installed,
then click Next.
Where should Confluence 6.9.1 be installed?
[/opt/atlassian/confluence]
#这里填写自定义目录
/usr/local/atlassian/confluence

Default location for Confluence data
[/var/atlassian/application-data/confluence]

Configure which ports Confluence will use.
Confluence requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access
Confluence through your browser. The Control port is used to Startup and
Shutdown Confluence.
Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
#端口默认8090
1

Confluence can be run in the background.
You may choose to run Confluence as a service, which means it will start
automatically whenever the computer restarts.
Install Confluence as Service?
Yes [y, Enter], No [n]
#自动启动 选择y
y

Extracting files ...

Please wait a few moments while we configure Confluence.

Installation of Confluence 6.9.1 is complete
Start Confluence now?
Yes [y, Enter], No [n]
#选择y
y

Please wait a few moments while Confluence starts up.
Launching Confluence ...

Installation of Confluence 6.9.1 is complete
Your installation of Confluence 6.9.1 is now ready and can be accessed via
your browser.
Confluence 6.9.1 can be accessed at http://localhost:8090
Finishing installation ...

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

https://blog.csdn.net/weixin_41004350/article/details/80590421

Enter the browser to access, if it is English, you can select [Language] Chinese, select [Product Installation

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Don't select any plugins yet

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Record the server ID (B5BE-SJ3C-N42I-XCN0)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Extract the cracked file and close Confluence

# 进入你安装的目录
cd /usr/local/atlassian/confluence    
 # 关闭confluence
bin/stop-confluence.sh  
# 将confluence 下面的一个atlassian-extras-decoder-v2-3.3.0.jar包复制一份出来
cp confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.3.0.jar ~/

# 将其改名为atlassian-extras-2.4.jar
mv ~/atlassian-extras-decoder-v2-3.3.0.jar ~/atlassian-extras-2.4.jar
#安装传输工具
cd ~
yum -y install lszrz

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Cracked files, there are in the source code.

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)
Then the local window computer operation:
① Open the downloaded cracking tool, run confluence_keygen.jar ②Fill in
the recorded server ID, and fill in the Name.
③Click gen, generate key and record.
④ Click patch and select the atlassian-extras-2.4.jar file that has just been downloaded to the local to crack.
⑤Do not close the cracking tool, you will need to copy the key in the key later

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

OK, after the cracking is complete, send the cracked file back to the server

cd ~
mkdir bak
cd bak
# 传回服务器后,将名称改回之前的名称
mv atlassian-extras-2.4.jar atlassian-extras-decoder-v2-3.3.0.jar

# 然后覆盖回原路径
mv atlassian-extras-decoder-v2-3.3.0.jar /usr/local/atlassian/confluence/confluence/WEB-INF/lib/

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Confluence itself does not integrate the mysql driver. You need to download and upload it yourself. Originally, when you installed, after entering the key, you would need to fill in the mysql connection information. There will be a link to the official document to teach you how to configure mysql. However, you need to restart after the configuration is completed, which will cause problems with the previous cracking. Therefore, you must restart it after completing it together. The official tutorial document address is as follows:
https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html
source code includes: mysql driver
decompress and upload mysql-connector-java-5.1.46-bin.jar to the server , Put it under the class directory of confluence:

sz 

cp mysql-connector-java-5.1.46-bin.jar /usr/local/atlassian/confluence/lib/

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

  • After the above operations are completed, restart the confluence after the restart is complete,

    I don’t want to spend money to make sure there is no way to trouble

service confluence start

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Go back to the key input interface, enter the key recorded above [I said don’t close the cracking software before], and click Next

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Choose my own database

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

OK, the installation is now complete. Regarding the use of Confluence, http://www.confluence.cn/pages/viewpage.action?pageId=360467, is the interface description used for software development? It fits the idea of ​​software development process documentation very well .

  • SVN installation
    1. Install svnserve through yum command
    yum -y install subversion

    "Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

2. Create a version library directory (this is only a directory, and provide a storage location for later creation of the version library)

mkdir /var/svnrepos
  1. Create a repository directory
    svnadmin create /var/svnrepos/svn

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

  1. Configure svn

    authz: ​​Responsible for the management of account permissions, controlling whether the account has read and write permissions
    passwd: Responsible for the management of the user list of accounts and passwords
    svnserve.conf: Svn server configuration file

    cd /var/svnrepos/svn/conf

    "Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Edit authz file
[/]: indicates the root directory, that is, /var/svnrepos
admin = rw: indicates that user luo has read and write permissions to the root directory.

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Edit passwd file

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

Edit the svnserve.conf file (note: there can be no spaces in front of the configuration, it must be written at the top)
anon-access = none: means that anonymous users are prohibited from accessing.
auth-access = write: indicates that authorized users have read and write permissions.
password-db = passswd: Specify the username and password file, that is, the passwd file.
authz-db = authz: ​​Specify the authority profile, that is, the authz file.
realm = /var/svnrepos: Specify the authentication domain, that is, the /var/svnrepos directory.

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

"Internet Architecture" Software Architecture-Continuous Release Management of Software Environment (Part 1)

PS: This time I mainly talked about the problems in project management and how to solve them. In addition, I talked about the installation of confluence and svn, which is very good software. Confluence talked about some black technology cracking schemes.

Guess you like

Origin blog.51cto.com/12040702/2588451