0

I'm new to Geode and Im creating a geode container in Docker with a bash script. After this, I will be clustering Geode.

Since I've never really worked with Geode before, I'm not sure how to test to be sure everything is working properly. For instance, I'd use a hello world jar to test my alpine cluster, but how can I test Geode to be sure everything is up and running?

I'm attaching a copy of my bash script. Thanks a ton in advance for any help!

docker stop geodesrv && docker rm geodesrv;

docker network create gravitasnw;


echo "***********Starting Geode Container**************";
 docker run -d -it \
      -p MyIP:10334:10334 \
      -p MyIP:1099:1099 \
      -p MyIP:40411:40411 \
    --name geodesrv --hostname geodesrv --net gravitasnw apachegeode/geode;
     sleep 3s;

     echo "***********Starting Locator & Server***************";
      docker exec -it geodesrv bash -c 'gfsh -e "start locator      --name=locator1 --J=-Dgemfire.jmx-manager-hostname-for-  clients=162.243.207.235 --hostname-for-clients=162.243.207.235" -e "start server --name=server1"';
        echo "Sleep 25s to allow the initial locator and server to come online..";
       sleep 35s;

         #Servers Online At This Point
        #List Member
          echo "*********Connecting to Locator - List Member*************";
        docker exec -it geodesrv bash -c 'gfsh -e "connect --locator=localhost[10334]" -e"list members"';
            sleep 2s;

       #Create Region
      echo "***********Creating Region*************";
      docker exec -it geodesrv bash -c 'gfsh -e "connect            --locator=localhost[10334]" -e"create region --name=regionA --type=REPLICATE_PERSISTENT"';
        sleep 10s;

     #List Region
        echo "**********List Region***********";
      docker exec -it geodesrv bash -c 'gfsh -e "connect --locator=localhost[10334]" -e"list regions"';
     sleep 2s;

     #Put Item in Cache
     echo "**********Put Item in Cache************";
      docker exec -it geodesrv bash -c 'gfsh -e "connect       --locator=localhost[10334]" -e"put --region=regionA --key=\"1\" --value=\"one\""';
     sleep 2s;

     #Query Cache
      echo "************Query Cache*************";
    docker exec -it geodesrv bash -c 'gfsh -e "connect --locator=localhost[10334]" -e"query --query=\"select * from /regionA\""';
    sleep 2s;
Marshall
  • 31
  • 7
  • Well geode locator and server are java processes so you could look for them. You also can use the cache.xml like this https://stackoverflow.com/q/45053042/1964277 to setup your regions. Otherwise your test looks fine: put some data and check you can get it. – rupweb Nov 28 '17 at 20:40
  • See also https://stackoverflow.com/q/31171923/1964277 – rupweb Nov 28 '17 at 20:44
  • Great, thank you so much for your response! :) – Marshall Nov 28 '17 at 21:20
  • if you are familiar with gfsh commands, you can attach to the container and start gfsh. Set gfsh to connect the locator(s) and then you can do queries like put and get or inspect the region. – Yifan Wu May 29 '18 at 00:27

0 Answers0