Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug fix for shell scripts in sandbox directory #898

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Bluebore
Copyright (c) 2015, Baidu.inc
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Baidu File System (BFS) is a distributed file system designed to support rea
2. High throughput
* High performance data engine to maximize IO utils.
3. Low latency
* Global load balance and slow node detection.
* Global load balance and straggling node detection.
4. Linear scalability
* Support multi data center deployment and up to 10,000 data nodes.

Expand All @@ -31,7 +31,7 @@ The Baidu File System (BFS) is a distributed file system designed to support rea
2. Find something you are interested in and start working on it.
3. Test your code by simply running `make test` and `make check`.
4. Make a pull request.
5. Once your code has passed the code-review and merged, it will be run on thousands of servers :)
5. Once your code has passed the code-review and merged, it will run on thousands of servers :)


## Contact us
Expand Down
6 changes: 3 additions & 3 deletions sandbox/clear.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

killall -9 nameserver
killall -9 chunkserver
killall -9 bfs_client
killall -9 nameserver > /dev/null 2>&1
killall -9 chunkserver > /dev/null 2>&1
killall -9 bfs_client > /dev/null 2>&1

rm -rf nameserver* chunkserver*
rm -rf master* slave*
Expand Down
10 changes: 9 additions & 1 deletion sandbox/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ if [ "$1"x = "x" ]; then
ns_num=1;
elif [ "$1x" == "raftx" ]; then
ns_num=3
elif [ "$1x" == "master_slave" ]; then
elif [ "$1" == "master_slave" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elif [ "$1x" == "master_slavex" ]; then?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think each one is ok! when we use "", it is OK to use "$1"even when $1 == NULL.
Traditionally, we can use [ x$1 == x ] or [ "$1" == "" ], but combining them together seems werid.
Of course, it is my own idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, please solve this pull request. I am not familiar with git. And I have made a mistake, which creates the pull request from my master branch. It is really annoying.

ns_num=2
elif [ "$1" == "-h" ]; then
echo "Usage:"
echo " $0 [mode = none | master_slave | raft | -h]"
echo " none: one nameserver, default mode."
echo " master_slave: two nameservers, one is master and the other is slave."
echo " raft: three nameservers, master server is choosen by inbuilt raft protocol."
echo " -h: show this usage."
exit 0
fi

echo '--default_replica_num=3' >> bfs.flag
Expand Down
6 changes: 6 additions & 0 deletions sandbox/small_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ fi


sleep 5
if [ "$1"x == "raft"x ]; then
sleep 30
fi

# Test sl
./bfs_client ls /
Expand Down Expand Up @@ -110,6 +113,9 @@ do
done;

sleep 10
if [ "$1"x == "raft"x ]; then
sleep 30
fi
./bfs_client get /bin/bfs_client ./binary
rm -rf ./binary

Expand Down
12 changes: 8 additions & 4 deletions sandbox/start_bfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,29 @@ do
cd nameserver$i;
./bin/nameserver --node_index=$i 1>nlog 2>&1 &
echo $! > pid
cd -
echo "start nameserver$i with pid `cat pid`"
cd - > /dev/null
done;

if [ "$1"x == "master_slave"x ]; then
cd nameserver0;
./bin/nameserver --master_slave_role=slave --node_index=0 1>nlog 2>&1 &
echo $! > pid
cd -
echo "start slave nameserver0 with pid `cat pid`"
cd - > /dev/null
sleep 1
cd nameserver1;
./bin/nameserver --master_slave_role=master --node_index=1 1>nlog 2>&1 &
echo $! > pid
cd -
echo "start master nameserver1 with pid `cat pid`"
cd - > /dev/null
fi

for i in `seq 0 3`;
do
cd chunkserver$i;
./bin/chunkserver --chunkserver_port=802$i 1>clog1 2>&1 &
echo $! > pid
cd -
echo "start chunkserver$i with pid `cat pid` at port 802$i"
cd - > /dev/null
done