nebula-docker-compose icon indicating copy to clipboard operation
nebula-docker-compose copied to clipboard

make console depend on all graphds

Open wey-gu opened this issue 3 years ago • 1 comments

close: #126

credit goes to @imrefazekas

wey-gu avatar Aug 26 '22 02:08 wey-gu

As observed by @imrefazekas it took some time for the cluster to be ready to receive the console call, this change helped fix it.

wey-gu avatar Aug 26 '22 02:08 wey-gu

why this? console just connect to FIRST graph, no need to wait other graphds. prefer a loop like: https://github.com/vesoft-inc/nebula-python/blob/master/tests/docker-compose.yaml

HarrisChu avatar Oct 20 '22 06:10 HarrisChu

        for i in `seq 1 60`;do
          var=`nebula-console -addr graphd0 -port 9669 -u root -p nebula -e 'ADD HOSTS "172.28.2.1":9779,"172.28.2.2":9779,"172.28.2.3":9779;'`;
          if [[ $$? == 0 ]];then
            break;
          fi;
          sleep 1;
          echo "retry to add hosts.";
        done && tail -f /dev/null;

HarrisChu avatar Oct 20 '22 06:10 HarrisChu

        for i in `seq 1 60`;do
          var=`nebula-console -addr graphd0 -port 9669 -u root -p nebula -e 'ADD HOSTS "172.28.2.1":9779,"172.28.2.2":9779,"172.28.2.3":9779;'`;
          if [[ $$? == 0 ]];then
            break;
          fi;
          sleep 1;
          echo "retry to add hosts.";
        done && tail -f /dev/null;

This is better, I'll close this, could you port your implementation here?

wey-gu avatar Oct 20 '22 06:10 wey-gu