Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
364a2f1f
Commit
364a2f1f
authored
Aug 29, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more docs
parent
ec901d82
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
access_http.md
docs/access_http.md
+0
-0
combo_channel.md
docs/combo_channel.md
+3
-8
No files found.
docs/access_http.md
0 → 100644
View file @
364a2f1f
This diff is collapsed.
Click to expand it.
docs/combo_channel.md
View file @
364a2f1f
...
@@ -319,7 +319,7 @@ TRACE: 09-06 10:40:42: * 0 server.cpp:192] S[0]=0 S[1]=0 S[2]=0 [total=0]
...
@@ -319,7 +319,7 @@ TRACE: 09-06 10:40:42: * 0 server.cpp:192] S[0]=0 S[1]=0 S[2]=0 [total=0]
启动后每个Server每秒会打印上一秒收到的流量,目前都是0。然后我们在本地启动使用DynamicPartitionChannel的Client,初始化DynamicPartitionChannel的代码如下:
启动后每个Server每秒会打印上一秒收到的流量,目前都是0。然后我们在本地启动使用DynamicPartitionChannel的Client,初始化DynamicPartitionChannel的代码如下:
```
c++
```
c++
...
...
baidu
::
rpc
::
DynamicPartitionChannel
channel
;
baidu
::
rpc
::
DynamicPartitionChannel
channel
;
baidu
::
rpc
::
PartitionChannelOptions
options
;
baidu
::
rpc
::
PartitionChannelOptions
options
;
options
.
succeed_without_server
=
true
;
// 表示允许server_list在DynamicPartitionChannel.Init启动时为空,否则Init会失败。
options
.
succeed_without_server
=
true
;
// 表示允许server_list在DynamicPartitionChannel.Init启动时为空,否则Init会失败。
...
@@ -328,19 +328,16 @@ TRACE: 09-06 10:40:42: * 0 server.cpp:192] S[0]=0 S[1]=0 S[2]=0 [total=0]
...
@@ -328,19 +328,16 @@ TRACE: 09-06 10:40:42: * 0 server.cpp:192] S[0]=0 S[1]=0 S[2]=0 [total=0]
LOG
(
ERROR
)
<<
"Fail to init channel"
;
LOG
(
ERROR
)
<<
"Fail to init channel"
;
return
-
1
;
return
-
1
;
}
}
...
...
```
```
名字服务"file://server_list"的内容是:
名字服务"file://server_list"的内容是:
```
```
0.0.0.0:8004 0/3 # 表示3分库中的第一个分库,其他依次类推
0.0.0.0:8004 0/3 # 表示3分库中的第一个分库,其他依次类推
0.0.0.0:8004 1/3
0.0.0.0:8004 1/3
0.0.0.0:8004 2/3
0.0.0.0:8004 2/3
```
```
****
3分库方案的3个库都在8004端口对应的server上。启动Client后Client发现了8004,并向其发送流量。
3分库方案的3个库都在8004端口对应的server上。启动Client后Client发现了8004,并向其发送流量。
```
```
...
@@ -406,8 +403,6 @@ TRACE: 09-06 10:57:15: * 0 server.cpp:192] S[0]=208453 S[1]=276803 S[2]=0 [tot
...
@@ -406,8 +403,6 @@ TRACE: 09-06 10:57:15: * 0 server.cpp:192] S[0]=208453 S[1]=276803 S[2]=0 [tot
在我们这儿的场景中,3分库和4分库的容量是一样的,都是1。所有的3库都在8004,所有的4库都在8005,所以这两个Server的流量比例就是分库数的比例。
在我们这儿的场景中,3分库和4分库的容量是一样的,都是1。所有的3库都在8004,所有的4库都在8005,所以这两个Server的流量比例就是分库数的比例。
我们可以让4分库方案加入更多机器。修改server_list加入8006:
我们可以让4分库方案加入更多机器。修改server_list加入8006:
```
```
...
@@ -449,7 +444,7 @@ TRACE: 09-06 11:11:54: * 0 server.cpp:192] S[0]=135534 S[1]=180386 S[2]=180333
...
@@ -449,7 +444,7 @@ TRACE: 09-06 11:11:54: * 0 server.cpp:192] S[0]=135534 S[1]=180386 S[2]=180333
我们尝试下掉3分库中的一个分库:
我们尝试下掉3分库中的一个分库:
```
```
0.0.0.0:8004 0/3
0.0.0.0:8004 0/3
0.0.0.0:8004 1/3
0.0.0.0:8004 1/3
#0.0.0.0:8004 2/3
#0.0.0.0:8004 2/3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment