griddb / griddb-docker

Dockerfile for GridDB
Apache License 2.0
3 stars 6 forks source link

Solution for error A01102 when starting GridDB 5.3 #9

Open NguyenNamUET opened 12 months ago

NguyenNamUET commented 12 months ago

I used the Dockerfile and start-griddb.sh file in griddb-docker/tree/main/griddb/5.3/bionic But after building the image (docker build -t griddb_server) and start container (docker-compose up -d)

My docker-compose.yml file

version: '3'
services:
  griddb:
    container_name: griddb_server
    image: griddb_server
    hostname: localhost
    ports:
      - '10001:10001'
    volumes:
      - "griddb_data:/var/lib/gridstore"
volumes:
  griddb_data:
    driver: local

But after checking the container log, there's an error

A01102: You can't execute the command because during recovery.

And executing

gs_stat -u admin/admin

yield result with no active cluster

"cluster": {
        "activeCount": 1,
        "nodeStatus": "INACTIVE"
}

So after many hours of investigating, according to this document, I must start node before join node into cluster Moreover, command gsserver is redundant after adding start node so I remove it and start-griddb.sh file needs to update to

# Reference this file: griddb-docker/blob/main/griddb/start-griddb.sh
# Start service
gs_startnode -u $GRIDDB_USERNAME/$GRIDDB_PASSWORD -w
gs_joincluster -u $GRIDDB_USERNAME/$GRIDDB_PASSWORD -c $GRIDDB_CLUSTER_NAME -w
# Wait 
tail -f /var/lib/gridstore/log/gsstartup.log
knonomura commented 4 months ago

I've improved start-griddb.sh for GridDB V5.6CE by 68b37c8. I adopted join_cluster() method adding loop to join cluster in start-griddb.sh. Could you try it ?