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

how to define the conf --when run the example counter. #9

Closed
ghost opened this issue Mar 20, 2018 · 6 comments
Closed

how to define the conf --when run the example counter. #9

ghost opened this issue Mar 20, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 20, 2018

when i run the example counter,i got some problem like "". i think it is caused by undefine conf. so how do i define the conf ? please tell me ,thank you.
DEFINE_string(conf, "", "Initial configuration of the replication group");

the error :
node Counter:127.0.0.1:8100:0 term 1 start pre_vote
W0320 16:40:10.782916 13281 /home/robin/github/braft/src/braft/node.cpp:1305] node Counter:127.0.0.1:8100:0 can't do pre_vote as it is not in 192.168.109.128:8100:0,192.168.109.128:8101:0,192.168.109.128:8102:0

@ghost
Copy link
Author

ghost commented Mar 20, 2018

i'm a newer programer and i'm very hopely to try the brafter

@chenzhangyi
Copy link
Collaborator

Did you run counter_server via run_server.sh?

@ghost
Copy link
Author

ghost commented Mar 20, 2018

yes , i use the batch script run_server.sh to run the server

@ghost
Copy link
Author

ghost commented Mar 20, 2018

my steps:

  1. git clone
  2. use command "mkdir build && cd build && cmake .. && make" to compile the braft
  3. compile the counter : cd example/counter && cmake . && make
  4. run the counter:
    ./run_server.sh
    ./run_client.sh

i don't know whether there has some wrong steps or wrong parameters.

@chenzhangyi
Copy link
Collaborator

The ip via hostname -i in run_server.sh is different with the ip via butil::my_ip() in the program. To simply solve this issue, you can rewrite the IP variable in run_server.sh to '127.0.0.1' directly. The root cause is hard to figured out, more information (kernel version, linux distribution, output of `hostname -i' etc) may help to find the issue.

@ghost
Copy link
Author

ghost commented Mar 20, 2018

it's just like what you said, i can test the counter now. thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant