View warning: Show warnings; backup library structure: mysqldump Library-add-drop-table > path
Add User: Grant Select,insert on library name to ' user name ' @ ' 172.8.8.8 ' identified by ' password '; flush privileges
All permissions: Grant all privileges on * * to ' name ' @ '% ' identified by ' mima ';----small Q
-----------------------------------------------------------------------------------------------------
"Introduction to process and operational model advantages and disadvantages"
Svn:subversion is a cross-platform, open source version control system that manages a variety of data over time, placed in a central repository (much like a file server or FTP server), and backs up every change to a file, facilitating bug-and-rollback versions.
Storage mode:
Bdb--berkeley DB, the Object security table type, through the background relational database implementation, the server is interrupted when it is possible to lock data;
fsfs--binaries, which are used for file system backend, NFS, etc., do not require database storage, but neither have entity files.
Work Flow:
① Create or copy a branch from the backbone in the Central Library;
② the code from the Central Library check out under this branch;
③ add your own code file, modify the existing code or delete the code of the file;
④commit code, if someone commits the code on the branch, you'll be prompted to expire the code, and you'll have to update it before you commit it. , the up code when there is a conflict, you need to resolve the conflict before committing.
For example, develop a day using SVN:
① first download the project group's latest code from the SVN server;
② into its own branch to develop, every hour to the server to submit their own branch code (easy to check back);
③ time to work, to merge their own branch into the server Main branch, a day of work completed, and reflected to the server;
Operational essentials:
OPS does not need to use SVN as much as development, but the management system's OPS personnel need to master
1, installation, deployment, maintenance, troubleshooting;
2, simple and practical, although most companies are developed to manage, such as the creation of warehouses, adding and deleting accounts;
3, simple understanding, operation and Maintenance is the developer, development and other personnel is the owner, operation and maintenance services to build up for development and use.
Access mode:
1, independent server access, such as: SVN://IP (domain name)/library name
2, with the help of HTTP services, for example: HTTP://IP (domain name)/library name (installed separately apache+svn or install Web interface Management CSVN)
3, direct local access, for example: file://application/svndata/library name
Advantages and Disadvantages:
1, each commit to retain the original copy, SVN data volume will burst;
2, if not connected to SVN server, basic can not work;
3, in the open source system development, many people do not run well.
A, the popularity of high, easy to use, interface, and more textbooks;
B, easy to manage, clear logic, suitable for the development of a few projects;
C, code consistency is very high, centralized SVN service in a certain way to ensure the security of data;
"Configure Installation"
General functionality of the thing, direct yum installation can, unless there is a special need, do not need to compile.
Check: Rpm-qa |grep Subversion
Installation: Yum install-y Subversion
===========================================================
Yum Install RPM package local not cleared method: Sed-i ' s#keepcache=0#keepcache=1#g '/etc/yum.conf
===========================================================
Yum will have several commands after installation: SVN two tab is out.
SVN svnadmin svndumpfilter svnlook svnrdump svnserve svnsync svnversion
First of all, to create a data storage directory, according to the requirements of the online environment to build, we are the experiment does not matter;
Mkdir-p/SVN/{SVNDATA,SVNPASSWD}
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/89/33/wKioL1gMSpfxbYMMAAEgVZX7iFg479.png-wh_500x0-wm_3 -wmp_4-s_3410014176.png "title=" 1.png "alt=" Wkiol1gmspfxbymmaaegvzx7ifg479.png-wh_50 "/>
Start: svnserver-d-r/svn/svndata/
Check: PS aux|grep svn lsof-i:3690 (port customizable)
Restart: Pkill svnserver;svnserver-d-r/svn/svndata/
To create a project repository:
Command: Svnadmin create/svn/svndata/sadoc//created Sadoc project library, can not use the idea of mkdir
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/89/33/wKioL1gMTK2QbMvLAADRGfkYYIg248.png-wh_500x0-wm_3 -wmp_4-s_2072934807.png "title=" 2.png "alt=" Wkiol1gmtk2qbmvlaadrgfkyyig248.png-wh_50 "/>
Records the original tree of the project library, Conf (config file), db (version record), Hook (Hook), Lock (Lock)
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/89/36/wKiom1gMTg3jqJd6AABOBJe40EQ210.png-wh_500x0-wm_3 -wmp_4-s_3977665683.png "title=" 3.png "style=" width:500px;height:450px; "alt=" Wkiom1gmtg3jqjd6aabobje40eq210.png-wh_50 "height=" width= "vspace=" 0 "hspace=" 0 "border=" 0 "/>
"Project Library Permissions Issues"
Cd/svn/svndata/sadoc/conf
CP svnserver.conf Svnserver.conf_bak//Pre-operation backup is a good practice for operations and maintenance
Sed-i ' s/# auth-access = write/auth-access = write/g ' svnserver.confsed-i ' s/# aono-access =read/anon-access = none/g ' s Vnserver.confsed-i ' s%# password-db = passwd%password-db =/svn/svnpasswd/passwd%g ' svnserve.confsed-i ' s%# authz-db = a uthz%authz-db =/svn/svnpasswd/authz%g ' svnserver.conf
The default access password is under the configuration file of the respective project library, but it is easy to manage, and is not enforced according to your own situation.
CP passwd authz/svn/svnpasswd/
chmod 700/SVN/SVNPASSWD//Security considerations, of course, can also be encrypted again, according to their own
VIM/SVN/SVNPASSWD/PASSWD//Add user, password
# # # This file is a example password file for svnserve.### It format is similar to that of svnserve.conf. As shown in the### example below it contains one sections labelled [users].### the name and password for each user follow, One account per line. [users]# Harry = harryssecret# sally = Sallyssecrettengxun = 123456 #等号前用户名, after the equals sign is the plaintext password Docuser = 654321 #更改配置文件要重启服 Change Authz and passwd.
Vim/svn/svnpasswd/authz//Set user or group access rights
### this file is an example authorization file for svnserve.### Its format is identical to that of mod_authz_svn Authorizationfiles.### as shown below each section defines authorizations for the path and### (optional) repository specified by the Section name.### the authorizations follow. an authorization line can refer to:### - a single user,### - a group of users defined in a special [groups] section,### - an alias defined in a special [aliases] section,### - all authenticated users, using the ' $authenticated ' token,### - only anonymous users, using the ' $anonymous ' token,### - anyone, using the ' * ' wildcard. [Aliases]# joe = /c=xz/st=dessert/l=snake city/o=snake oil, ltd./ou=research institute/cn=joe average[groups]# harry_and_sally = harry,sally# harry_sally_ and_joe = harry,sally,&joe# [/foo/bar]# harry = rw# &joe = r# * =# [repository:/baz/fuz]# @harry_and_sally = rw# * = ryanfa = a,b,tengxun #定义用户组, comma separated between users [sadoc:/] #格式: [Repository:/project/directory]------[/] represents the root directory, which is the/svn/svndata specified at SVN startup #[repo:/sadoc] Represents the @yanfa = rw #用户组前要加 @docuser to set permissions on Sadoc projects in the Repo repository = r #r, w,rw, , respectively, read, write, read and write, empty; The user must have defined in the configuration file
Restart: Pkill svnserver;svnserver-d-r/svn/svndata/sadoc/
"Client Access"
SVN server is not simple to store files one by one, the default FSFS format to store incremental content, packaged into a file;
Windows client:
Reference: http://jingyan.baidu.com/article/0aa223758081b788cc0d64e7.html
1, download TortoiseSVN and Chinese package patch, installation;
2, after installation, create a folder for the corresponding items, right-click the svn Checkout (check.out), enter the URL and save the path, such as
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/89/36/wKiom1gMV4mCGBizAAA1Fk3D9BE296.png-wh_500x0-wm_3 -wmp_4-s_29783865.png "title=" 4.png "alt=" Wkiom1gmv4mcgbizaaa1fk3d9be296.png-wh_50 "/>
3, enter the user name, password, put some files in the folder, and directories and so on, right-click the SVN commit (commit), as follows
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/36/wKiom1gMWQ3xgmO9AABv9-Y5e7Y589.png "style=" width : 330px;height:292px;float:left; "title=" 5.png "alt=" Wkiom1gmwq3xgmo9aabv9-y5e7y589.png "height=" 292 "width=" 330 " Vspace= "0" hspace= "0" border= "0"/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/33/wKioL1gMWQ3QNIKOAABa3zI5rHA971.png "style=" width : 350px;height:292px; "title=" 6.png "alt=" Wkiol1gmwq3qnikoaaba3zi5rha971.png "height=" 292 "width=" to "vspace=" 0 " Hspace= "0" border= "0"/>
4, after synchronization, you can directly see whether sync to the server side, right-click the tortoisesvn→ version of the browser (Repo Browser)
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/33/wKioL1gMWdKz25g1AAA7466Rb9o763.png "title=" 7.png " alt= "Wkiol1gmwdkz25g1aaa7466rb9o763.png"/>
5, every time we use to right-click SVN Update (update), to ensure that the content is up to date.
Note: Deleting a file also does so, committing synchronization.
Q: What happens if the repository address changes?
Select Folder Right-tortoisesvn→ reposition (relocate), enter the new address.
Within Windows, there is an SVN default directory that contains three authentication files
Svn.simple: Authentication information with Basic authentication method, encrypted by WinCrypt API
Svn.ssl.server: Include SSL server certificate
Svn.username: Contains authentication information for user authentication
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/89/33/wKioL1gMW5rR4qRmAAA7PuiOEzU948.png "title=" 8.png " alt= "Wkiol1gmw5rr4qrmaaa7puioezu948.png"/>
Linux client:
Check out the project library: SVN co svn://10.0.18.33/sadoc/data/svndata/sadoc--username=? --password=?
Local check-out: SVN co file://svn/svndata/sadoc/
error: Svn:can ' t convert string from ' UTF-8 ' to native encoding//resolve the following
Or:export lc_ctype= "ZH_CN. UTF-8 "
Or:export lc_ctype= "ZH_CN. GB2312 "
Or:export lang= "ZH_CN. UTF-8 "(variable name is different)
Or:export lc_ctype= "en_US. UTF-8 "; Export lc_all=
Update Project library: SVN update svn://10.0.18.33/sadoc/data/svndata/sadoc--username=?
View project library: SVN ls svn://10.0.18.33/sadoc--username=? --password=? --verbose
Add File: SVN Add File/directory name
Submit file: After SVN ci-m "commit data"//Commit, the project library version has been upgraded to one-digit
(-M [--message] arg: Specify log information arg//Do not add this-m parameter will be an error!) )
Project Directory Specification:
Mkdir-p/data/svndata/sadoc/name/{trunk,branch,tag}//{Trunk, branch, version tag}
Commit: The modification of the working copy is submitted to the repository;
Add: File or directory Neru version control, the next time you submit;
Import: Submits files or directories that are not versioned to the repository control.
Included in the project library: SVN import/data/svndata/sadoc/name svn://10.0.18.33/sadoc-m "Import"
Attaching: Copying something from the trunk to a branch, less commonly used
SVN copy svn://10.0.18.33/sadoc/trunk svn://10.0.18.33/sadoc/branch/branch1-m "Create a branch"
"Enterprise on-line solution"
Small Business (figure left)
1, the general company personnel less, in order to facilitate the anytime, anywhere update, release fast;
2, often without testing personnel testing on-line, take the user to test, the user experience is poor;
3, according to the statistical site 50% of the fault is related to the code, but are responsible for the operation and maintenance personnel.
Suggestions:
A, personal computer build LNMP environment to test code, and have full-time personnel in the test server test;
b, the code on-line time, such as three days an on-line, to meet the needs of the same time must have principles, all for the Customer experience degree;
C, on-line to back up, a problem convenient rollback (Sina practice: First to the temporary directory, then direct MV past, or do the soft chain)
D, on-line operation by operation and maintenance operations, or the development of random update upload, out of the problem operation and maintenance is responsible, so too unscientific.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/36/wKiom1gMZjGR8xwbAAHYZBpuOFE469.png "title=" 8.png " Style= "WIDTH:350PX;HEIGHT:276PX;" alt= "Wkiom1gmzjgr8xwbaahyzbpuofe469.png" height= "276" width= "" vspace= "0" Hspace= "0" border= "0"/>650) this.width=650; "Src=" http://s4.51cto.com/wyfs02/M02/89/34/ Wkiol1gmzlurmrpuaaequetru-e517.png "title=" 9.png "style=" width:320px;height:290px; "alt=" Wkiol1gmzlurmrpuaaequetru-e517.png "height=" 290 "width=" "vspace=" 0 "hspace=" 0 "border=" 0 "/>
Medium Business (Figure right)
Have a strict process, the line is fully responsible for the operation, the development of a unified online script, backup script, rollback script, reduce the loss.
This article is from the "North Ice--q" blog, please be sure to keep this source http://beibing.blog.51cto.com/10693373/1864741
Getting started with SVN: Process Introduction Installation Configuration project library Configure client-on-line scenario