forked from Terry-Mao/bfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhapuyu
committed
Jun 16, 2016
1 parent
12ab0d4
commit ca0329b
Showing
19 changed files
with
89 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# bfsops | ||
The background management interface of BFS. | ||
|
||
## 初始化流程: | ||
|
||
###step 1 | ||
启动store、directory、proxy、pitchfork | ||
store启动后,zookeeper看到/rack 有store节点 | ||
|
||
###step 2: | ||
调用space()函数,初始化store,调用完成后,磁盘空间会被分配;bfs存储目录看到生成的volume文件。 | ||
|
||
###step 3: | ||
调用groups()函数,store分组,调用完成后,zookeeper看到/group/ 有组节点 | ||
|
||
###step 4: | ||
调用volumes()函数, 生效volume,调用完成后,zookeeper看到/volume/有volume节点 | ||
|
||
### Done | ||
# bfsops | ||
The background management interface of BFS. | ||
|
||
## 初始化流程: | ||
|
||
###step 1 | ||
启动store、directory、proxy、pitchfork | ||
store启动后,zookeeper看到/rack 有store节点 | ||
|
||
###step 2: | ||
调用space()函数,初始化store,调用完成后,磁盘空间会被分配;bfs存储目录看到生成的volume文件。 | ||
|
||
###step 3: | ||
调用groups()函数,store分组,调用完成后,zookeeper看到/group/ 有组节点 | ||
|
||
###step 4: | ||
调用volumes()函数, 生效volume,调用完成后,zookeeper看到/volume/有volume节点 | ||
|
||
### Done |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# -*- encoding:utf8 -*- | ||
|
||
# store. | ||
store_admin_port = 6063 | ||
store_stat_port = 6061 | ||
store_block_size = 32 # GB | ||
|
||
zk_hosts = '127.0.0.1:2181' | ||
# zookeeper port:2181. | ||
zk_hosts = '127.0.0.1' | ||
|
||
# log dir. | ||
log_dir = '/tmp' |
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import urllib2 | ||
import json | ||
|
||
# initialize bfs space | ||
def space(): | ||
url = 'http://127.0.0.1:9000/bfsops/initialization' | ||
# ips 机器的ip列表 | ||
# dirs 磁盘目录 | ||
# size 每块磁盘的空间大小 | ||
value = {"ips":"xx.xx.xx.xx, yy.yy.yy.yy","dirs":"/data1/bfsdata/,/data2/bfsdata/","size":"10T"} | ||
|
||
jdata = json.dumps(value) | ||
req = urllib2.Request(url, jdata, headers = {"Content-type":"application/json"}) | ||
response = urllib2.urlopen(req) | ||
return response.read() | ||
# initialize groups | ||
def groups(): | ||
url = 'http://127.0.0.1:9000/bfsops/groups' | ||
# ips 要分组的ip列表 | ||
# copys 副本数(包括本身) | ||
# racks 跨机架 默认1即可,具体请参考ops代码 | ||
value = {"ips":"xx.xx.xx.xx, yy.yy.yy.yy", "copys":2, "rack":1} | ||
|
||
jdata = json.dumps(value) | ||
req = urllib2.Request(url, jdata, headers = {"Content-type":"application/json"}) | ||
response = urllib2.urlopen(req) | ||
return response.read() | ||
|
||
# initialize volumes | ||
def volumes(): | ||
url = 'http://127.0.0.1:9000/bfsops/volumes' | ||
# groups 生效某个group | ||
value = {"groups":"2"} | ||
|
||
jdata = json.dumps(value) | ||
req = urllib2.Request(url, jdata, headers = {"Content-type":"application/json"}) | ||
response = urllib2.urlopen(req) | ||
return response.read() | ||
|
||
# store启动后,zookeeper看到/rack 有store节点 | ||
|
||
# 初始化流程: | ||
# 分别依次调用3个函数,分别完成:初始化store;store分组;生效volume. | ||
#step 1: | ||
#space() | ||
#调用完成后,磁盘空间会被分配;bfs存储目录看到生成的volume文件。 | ||
|
||
#step 2: | ||
#groups() | ||
#调用完成后,zookeeper看到/group/ 有组节点 | ||
|
||
#step 3: | ||
#volumes() | ||
#调用完成后,zookeeper看到/volume/有volume节点 | ||
|
||
|
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.