参考http://www.cnblogs.com/tesky0125/p/5973642.html

1.安装gerrit replication插件
mkdir ~/tmp
cp gerrit-2.14.war tmp
cd tmp
unzip gerrit-2.14.war
cd WEB-INF/plugins
[gerrit2@pre-srv44 plugins]$ pwd
/home/gerrit2/tmp/WEB-INF/plugins
##ssh -p 29418 gerrit2@172.16.181.60 gerrit plugin install -n replication.jar - <replication.jar
##ssh -p 29418 gerrit2@172.16.181.80 gerrit plugin ls

[gerrit2@pre-srv44 .ssh]$ alias
alias ssh-gerrit='ssh -p 29418 -i ~/.ssh/gerritadmin 172.16.181.80 -l gerrit2'
等价于ssh -p 29418 -i ~/.ssh/gerritadmin gerrit2@172.16.181.80
[gerrit2@pre-srv44 .ssh]$ ssh-gerrit gerrit plugin ls
Name Version Status File
-------------------------------------------------------------------------------
[gerrit2@pre-srv44 .ssh]$ ssh-gerrit gerrit plugin install -n replication.jar - </home/gerrit2/tmp/WEB-INF/plugins/replication.jar
fatal: remote installation is disabled
[gerrit2@pre-srv44 .ssh]$ git config --file /home/gerrit2/gerrit_site_http/etc/gerrit.config plugins.allowRemoteAdmin true
[gerrit2@pre-srv44 etc]$ ssh-gerrit gerrit --help
[gerrit2@pre-srv44 etc]$ ssh-gerrit gerrit flush-caches
[gerrit2@pre-srv44 bin]$ ./gerrit.sh start
Starting Gerrit Code Review: OK
[gerrit2@pre-srv44 .ssh]$ ssh-gerrit gerrit plugin install -n replication.jar - </home/gerrit2/tmp/WEB-INF/plugins/replication.jar
[gerrit2@pre-srv44 bin]$ ssh-gerrit gerrit plugin ls
Name Version Status File
-------------------------------------------------------------------------------
replication v2.14 ENABLED replication.jar

replication安装成功

gerrit增加ACCESS权限
Global Capabilities
Create Account: Administrators
Create Group: Administrators

### 以下斜体字可以忽略

[gerrit2@pre-srv44 .ssh]$ ll
total 24
-rw-r-x---+ 1 gerrit2 root 1675 Jun 12 09:59 admin
-rw-r-xr--+ 1 gerrit2 root 387 Jun 12 09:59 admin.pub
-rw-r--r-- 1 gerrit2 root 112 Jul 8 17:37 config
-rw------- 1 gerrit2 root 1675 Jun 24 10:56 gerritadmin
-rw-r--r-- 1 gerrit2 root 393 Jun 24 10:56 gerritadmin.pub
-rw-r--r-- 1 gerrit2 root 1202 Jul 8 17:09 known_hosts
“+” 什么意思
[gerrit2@pre-srv44 .ssh]$ vi config
Host hostgitlab
   Hostname gitlab.test.mycompany.com
   User git
   IdentityFile ~/.ssh/admin.pub
[gerrit2@pre-srv44 devwork]$ git clone hostgitlab:dev_group/test_project1.git
Cloning into 'test_project1'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0654 for '/home/gerrit2/.ssh/admin.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/gerrit2/.ssh/admin.pub
git@gitlab.test.mycompany.com's password:
Permission denied, please try again.

IdentityFile ~/.ssh/admin.pub 用公钥不对,应该指定私钥

[gerrit2@pre-srv44 .ssh]$ vi config
Host hostgitlab_admin
   Hostname gitlab.test.mycompany.com
   User git
   IdentityFile ~/.ssh/admin

Host hostgitlab_gerritadmin
   Hostname gitlab.test.mycompany.com
   User git
   IdentityFile ~/.ssh/gerritadmin

[gerrit2@pre-srv44 devwork]$ ssh -T hostgitlab_gerritadmin
Welcome to GitLab, gerrit2!
[gerrit2@pre-srv44 devwork]$ ssh -T hostgitlab_admin
Welcome to GitLab, gerrit2!
都成功了

ssh -vT hostgitlab_admin 调试

Gitlab上设置test-project1工程
前面我们在Gitlab上搭建了一个 test_project1 的工程,普通用户是没有办法去 push 的,只能使用 git review 命令提交. 而 git review 命令需要 .gitreview 文件存在于项目目录里。
用 gerrit2用户添加.gitreview 文件(只有gerrit2用户是项目创建者,可以直接push,其他用户只能git review
[gerrit2@pre-srv44 ~]$ cd devwork/
[gerrit2@pre-srv44 devwork]$ ls
[gerrit2@pre-srv44 devwork]$ git clone hostgitlab_admin:dev_group/test_project1.git
Cloning into 'test_project1'...
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 11 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (11/11), done.
[gerrit2@pre-srv44 devwork]$ ls
test_project1
[gerrit2@pre-srv44 devwork]$ cd test_project1/
[gerrit2@pre-srv44 test_project1]$ vim .gitreview
[gerrit]
host=gitlab.test.mycompany.com   #此处写错了,应该是host=172.16.181.80  gerrit地址 写作gitlab地址错误,后改正
port=29418
project=test_project1.git

[gerrit2@pre-srv44 test_project1]$ git add .gitreview
[gerrit2@pre-srv44 test_project1]$ git config --global user.name 'gerrit2'
[gerrit2@pre-srv44 test_project1]$ git config --global user.email 'gerrit2@email'
[gerrit2@pre-srv44 test_project1]$ git commit .gitreview -m 'add .gitreview file by gerrit.'
[master 698ca36] add .gitreview file by gerrit.
1 file changed, 4 insertions(+)
create mode 100644 .gitreview
[gerrit2@pre-srv44 test_project1]$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 373 bytes | 373.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To hostgitlab_admin:dev_group/test_project1.git
b0e358d..698ca36 master -> master
[gerrit2@pre-srv44 test_project1]$

Gerrit上设置 test_project1工程
在Gerrit上创建 test_project1 项目
要知道review是在gerrit上,而gerrit上现在是没有项目的,想让gitlab上的项目能在gerrit上review的话,必须在gerrit上创建相同的项目,并有相同的仓库文件.
用gerrit2用户在 Gerrit 上创建 test-project1 项目
[gerrit2@pre-srv44 devwork]$ ssh-gerrit gerrit create-project test_project1
登陆gerrit界面,发现test_project1工程已经创建了。(这种方式创建的项目是空的)

clone --bare Gitlab上的仓库到 Gerrit (gerrit上的项目最好是从gitlab上git clone --bare过来,并且项目不要为空)
[gerrit2@pre-srv44 ~]$ cd gerrit_site_http
[gerrit2@pre-srv44 gerrit_site_http]$ ls
bin cache data db etc git index lib logs plugins static tmp
[gerrit2@pre-srv44 gerrit_site_http]$ cd git
[gerrit2@pre-srv44 git]$ ls
All-Projects.git All-Users.git test_project1.git
[gerrit2@pre-srv44 git]$ cd test_project1.git/
[gerrit2@pre-srv44 test_project1.git]$ ls
branches config HEAD hooks logs objects refs
[gerrit2@pre-srv44 test_project1.git]$ cd ..
[gerrit2@pre-srv44 git]$ ls
All-Projects.git All-Users.git test_project1.git
[gerrit2@pre-srv44 git]$ mv test_project1.git test_project1.git.bak
[gerrit2@pre-srv44 git]$ ls
All-Projects.git All-Users.git test_project1.git.bak
[gerrit2@pre-srv44 git]$ git clone --bare hostgitlab_admin:dev_group/test_project1.git
Cloning into bare repository 'test_project1.git'...
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 14 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (14/14), done.
[gerrit2@pre-srv44 git]$ ls
All-Projects.git All-Users.git test_project1.git test_project1.git.bak
[gerrit2@pre-srv44 git]$ cd test_project1.git
[gerrit2@pre-srv44 test_project1.git]$ ls
branches config description HEAD hooks info objects packed-refs refs
[gerrit2@pre-srv44 test_project1.git]$

同步 Gerrit的test_project1 项目到 Gitlab 上的 test_project1 项目目录中
当用户git review后,代码通过 jenkins 测试、人工 review 后,代码只是 merge 到了 Gerrit 的 test_project1 项目中,并没有 merge 到 Gitlab 的 test-project1 项目中,所以需要当 Gerrit test_project1 项目仓库有变化时自动同步到 Gitlab 的 test_project1 项目仓库中。
Gerrit 自带一个 Replication 功能可完成同步
现在只需要添加一个 replication.config 给 Gerrit

replication配置

[gerrit2@pre-srv44 etc]$ pwd
/home/gerrit2/gerrit_site_http/etc
[gerrit2@pre-srv44 etc]$ vim replication.config
[remote "test_project1"]
projects = test_project1
url = git@gitlab.test.mycompany.com:dev_group/test_project1.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
push = +refs/changes/*:refs/changes/*
threads = 3

重启
[gerrit2@pre-srv44 ~]$ ~/gerrit_site_http/bin/gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK

总结一下就是:现在gerrit上创建一个同名的project,然后删除,并在同样的位置从Gitlab克隆过来同名project覆盖。

测试
普通sisi用户

[sisi@pre-srv44 devwork]$ git clone git@gitlab.test.mycompany.com:dev_group/test_project1.git
Cloning into 'test_project1'...
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 14 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (14/14), done.
[sisi@pre-srv44 devwork]$ ls
test_project1
[sisi@pre-srv44 devwork]$ cd test_project1/
[sisi@pre-srv44 test_project1]$ ls
hello maintain
[sisi@pre-srv44 test_project1]$ touch testfile
[sisi@pre-srv44 test_project1]$ ls
hello maintain testfile
[sisi@pre-srv44 test_project1]$ git add testfile
[sisi@pre-srv44 test_project1]$ git commit -m 'add testfile'
[master a7b5f6c] add testfile
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 testfile
[sisi@pre-srv44 test_project1]$ git review
git: 'review' is not a git command. See 'git --help'.

没有Git review命令,

安装git review
[sisi@pre-srv44 test_project1]$ sudo yum install git-review

测试连接gerrit
[sisi@pre-srv44 test_project1]$ ssh -T -p 29418 sisi@172.16.181.80
The authenticity of host '[172.16.181.80]:29418 ([172.16.181.80]:29418)' can't be established.
RSA key fingerprint is 34:b8:66:84:01:26:96:0a:77:ab:60:0f:07:84:6a:2c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[172.16.181.80]:29418' (RSA) to the list of known hosts.

**** Welcome to Gerrit Code Review ****

Hi sisi, you have successfully connected over SSH.

Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:

git clone ssh://sisi@172.16.181.80:29418/REPOSITORY_NAME.git

连接成功

[sisi@pre-srv44 test_project1]$ vi .gitreview
[gerrit]
host=172.16.181.80 #gerrit地址 前述写作gitlab地址错误
port=29418
project=test_project1.git

[sisi@pre-srv44 test_project1]$ git review
Creating a git remote called "gerrit" that maps to:
ssh://sisi@172.16.181.80:29418/test_project1.git
Errors running git rebase -p -i remotes/gerrit/master
Cannot rebase: You have unstaged changes.
Please commit or stash them.

有未提交的变更,先提交了再说
[sisi@pre-srv44 test_project1]$
[sisi@pre-srv44 test_project1]$ git add .gitreview
[sisi@pre-srv44 test_project1]$ git commit -m 'mod .gitreview'
[master 45b7d34] mod .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)

再执行Git review
[sisi@pre-srv44 test_project1]$ git review
You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.

The outstanding commits are:

45b7d34 (HEAD -> master) mod .gitreview
a7b5f6c add testfile

Do you really want to submit the above commits?
Type 'yes' to confirm, other to cancel: yes
remote: Processing changes: refs: 1, done
remote: ERROR: [a7b5f6c] missing Change-Id in commit message footer
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 sisi@172.16.181.80:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://172.16.181.80:29418/test_project1.git
! [remote rejected] HEAD -> refs/publish/master ([a7b5f6c] missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://sisi@172.16.181.80:29418/test_project1.git'

失败,没有加添加change-id的钩子程序,这是gerrit必须的,按照提示命令执行
[sisi@pre-srv44 test_project1]$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 sisi@172.16.181.80:hooks/commit-msg ${gitdir}/hooks/
commit-msg 100% 4691 4.6KB/s 00:00
[sisi@pre-srv44 test_project1]$ git commit --amend

[sisi@pre-srv44 test_project1]$ git review
You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.

The outstanding commits are:

6e36ace (HEAD -> master) mod .gitreview
a7b5f6c add testfile

Do you really want to submit the above commits?
Type 'yes' to confirm, other to cancel: yes
remote: Processing changes: refs: 1, done
remote: ERROR: [a7b5f6c] missing Change-Id in commit message footer
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 sisi@172.16.181.80:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://172.16.181.80:29418/test_project1.git
! [remote rejected] HEAD -> refs/publish/master ([a7b5f6c] missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://sisi@172.16.181.80:29418/test_project1.git'
还是失败是因为多个commit,但是只有之后一个commit有change-id,之前一个没有
[sisi@pre-srv44 test_project1]$ git log
commit 6e36acec3243f1c33959873a30bdbc61ebd600df (HEAD -> master)
Author: sisi <sisi@mycompany.com>
Date: Sun Jul 8 22:45:07 2018 +0800

mod .gitreview

Change-Id: Ie390e2f6c049997d96a1190efc6c66bdbbb078fd

commit a7b5f6cadbd4f3585ceaac7d7a03883dcc60e238
Author: sisi <sisi@mycompany.com>
Date: Sun Jul 8 22:12:52 2018 +0800

add testfile ##这个commit没有change-id

commit 698ca363e60daca3f88760916112855687d9c3f2 (origin/master, origin/HEAD, gerrit/master)
Author: gerrit2 <gerrit2@email>
Date: Sun Jul 8 21:42:24 2018 +0800

add .gitreview file by gerrit.  #原始clone后的位置

硬回退到原始克隆时的位置
[sisi@pre-srv44 test_project1]$ git reset --hard 698c
HEAD is now at 698ca36 add .gitreview file by gerrit.
重新改,重新提交
[sisi@pre-srv44 test_project1]$ vi .gitreview
[gerrit]
host=172.16.181.80
port=29418
project=test_project1.git
[sisi@pre-srv44 test_project1]$ git add .gitreview
[sisi@pre-srv44 test_project1]$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: .gitreview

[sisi@pre-srv44 test_project1]$ git commit -m 'mod .gitreview'
[master e9a04cf] mod .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)
[sisi@pre-srv44 test_project1]$ git review
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote: http://172.16.181.80:8080/1 mod .gitreview
remote:
To ssh://172.16.181.80:29418/test_project1.git
* [new branch] HEAD -> refs/publish/master
这次提交成功,push到gerrit的refs/publish/master这个分支

进入gerrit进行code_review, gerrit2和sisi各+1,code_review得分是2,通过
但是verfied 无法+1,这个一般是由自动程序实现的,如jenkins

现在显示 Change 1 - Needs Verified Label

如何去掉Verified Label

方案1 改数据库(失败)
ssh-gerrit gerrit gsql

DELETE FROM approval_categories WHERE category_id = 'VRIF';
DELETE FROM approval_category_values WHERE category_id = 'VRIF';
找不到这两个表
https://stackoverflow.com/questions/7271208/gerrit-remove-need-verified-1-verified

方案2 参照安装verfied label 反向操作(成功)
https://www.cnblogs.com/kevingrace/p/5651447.html

[gerrit2@pre-srv44 .ssh]$ ls
admin admin.pub config gerritadmin gerritadmin.pub id_rsa known_hosts
[gerrit2@pre-srv44 .ssh]$ cp gerritadmin id_rsa #因为gerrit2用的是这私钥对应的公钥,改成默认名才能找到
[gerrit2@pre-srv44 .ssh]$ cd ~/devwork/cfg/
[gerrit2@pre-srv44 cfg]$ ls
[gerrit2@pre-srv44 cfg]$ git pull origin refs/meta/config
remote: Counting objects: 16, done
remote: Finding sources: 100% (16/16)
remote: Total 16 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (16/16), done.
From ssh://172.16.181.80:29418/All-Projects
* branch refs/meta/config -> FETCH_HEAD
[gerrit2@pre-srv44 cfg]$ vi project.config
删除[label "Verified"]及以下共7行
[gerrit2@pre-srv44 cfg]$ git add project.config
[gerrit2@pre-srv44 cfg]$ git commit -m 'del verified'
[master 2b01dc5] del verified
1 file changed, 7 deletions(-)
[gerrit2@pre-srv44 cfg]$ git push origin HEAD:refs/meta/config
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 301 bytes | 301.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1)
remote: Processing changes: refs: 1, done
To ssh://172.16.181.80:29418/All-Projects
36265fa..2b01dc5 HEAD -> refs/meta/config

提交成功

然后重启gerrit
[gerrit2@pre-srv44 bin]$ ./gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK
再登录gerrit查看,已经没有verified label了

点击summit,则此变更被merge到gerrit项目的主分支中了。

查看merge到gerrit的变更是否同步到gitlab

登录gitlab下,查看同名的项目,发现已经多了一个提交,这是通过gerrit的replication同步过来的。

可以查看replication的日志,在gerrit安装目录下logs\replication.log中。

gerrit配置和使用的更多相关文章

  1. Gerrit配置--用户配置

    环境: Gerrit Server:172.16.206.133 Client:172.16.206.129 1.在Gerrit服务器上创建用户 Gerrit服务器使用的是HTTP认证类型,并用htt ...

  2. gerrit 配置 apache2 反向代理(转载)

    Apache 2 Configuration To run Gerrit behind an Apache server using mod_proxy, enable the necessary A ...

  3. Gerrit 配置同步到多个仓库

    1.修改replication.config文件 [remote "xxx"] projects = Yilule.Core.Service #aliyun仓库 url = git ...

  4. gerrit配置跳过审核直接push到gitlab

    项目中有存放项目相关的文档,这些项目需要配置跳过审核再提交的操作.现在需要给某些组配置不审核直接提交的权限 方法: 使用管理员账号,到 projects -> access 页面下配置 refe ...

  5. Gerrit安装配置

    环境: CentOS 1611 + gerrit-2.11.4 (review.openstack.org) 1. 安装java1.8 (>1.7) [root@review ~]# yum i ...

  6. Gerrit+apache+H2数据库简单安装配置及建库流程

    Gerrit 是一个基于 Web 的代码评审和项目管理的工具,面向基于 Git 版本控制系统的项目.因此需要Apache.Mysql.GIT等相关软件的支持 系统配置: 新装的UBANTU LINUX ...

  7. [原创]CI持续集成系统环境--Gitlab+Gerrit+Jenkins完整对接

    近年来,由于开源项目.社区的活跃热度大增,进而引来持续集成(CI)系统的诞生,也越发的听到更多的人在说协同开发.敏捷开发.迭代开发.持续集成和单元测试这些拉风的术语.然而,大都是仅仅听到在说而已,国内 ...

  8. gerrit 使用笔记

    添加git hooks git库的钩子目录中有一个commit-msg脚本文件,可以在git执行commit时,在提交信息中自动添加一个唯一的Change-Id scp -P 29419 admin@ ...

  9. Gerrit系统框架介绍

    Gerrit目录介绍 转自:https://blog.csdn.net/tanshizhen119/article/details/79889242 先上图 bin/ : 主要是放gerrit.sh启 ...

随机推荐

  1. IK 中文分词器

    链接:https://github.com/wks/ik-analyzerIKAnalyzer是一个开源的,基于java语言开发的轻量级的中文分词工具包.从2006年12月推出1.0版开始,IKAna ...

  2. Linux 查看CPU信息、机器型号等硬件信息[转]

    查看CPU信息(型号) # cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c       8  Intel(R) Xeon(R) CPU    ...

  3. [LeetCode&Python] Problem 530. Minimum Absolute Difference in BST

    Given a binary search tree with non-negative values, find the minimum absolute difference between va ...

  4. lame定理求欧几里得算法的求余和赋值次数

    根据lame定理,根据欧几里得算法求(a,b)的最大公因数过程如下(假设a>b):

  5. rcnn系列

    提纲挈领 https://blog.csdn.net/linolzhang/article/details/54344350 SPP https://www.cnblogs.com/gongxijun ...

  6. 一个简单的 openssl 示例

    ////生成一个私钥////$key=openssl_pkey_new();openssl_pkey_export($key,$out);//等于下面写入的内容////将私钥写入一个文件////ope ...

  7. (1)HTML的组成(什么是标签、指令、转义字符、数据、标签字符表)

    html的组成:标签+指令+转义字符+数据 1.标签 <>内的,以字母开头,可以结合合法字符(- 或者数字),能被浏览器解析的符号 <!DOCTYPE html> #这个是系统 ...

  8. Liunx----vi编辑器

    关于vi编辑器基本的用法总结如下: vi是linux下的一款文编编辑器. 进入vi的方法:在系统启动起来后,直接键入vi或vi 文件名: 进去后输入内容方法:输入a或i,切换到编辑模式: 退出编辑模式 ...

  9. loopback 代码解析

    loopback-boot boot(app, __dirname);//server.js var instructions = compile(options); execute(app, ins ...

  10. day07 hadoop里面的RPC框架使用

    PS: RPC远程调用 Webservice啥的都是远程调用.下面简单介绍其使用过程 Hadoop已经实现了RPC框架,不用我们自己写,不过需要我们注意几点:1.发布服务端和客户端必须包名相同 1.服 ...