influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.0] Container restarts cannot find mounted data. Will clustering help?

Open marcospedreiro opened this issue 11 years ago • 1 comments

I am unsure if this is an issue with Kubernetes/GCE or the database image I am using, so I am posting this here for now. I apologize if this is turns out to be an issue with the database image.

Environment:

  • Running a GKE cluster on GCE that has a replication controller managing a pod that runs a database container.
  • Manually attached disk to GKE cluster as read/write through console (I have not been able to automate this process).

Behavior: If the replication controller for the database is deleted and recreated, there are no issues. However if the container/pod dies and gets automatically recreated, sometimes the database will crash and the logs will state that the filesystem is read only. When this happens, deleting the replication controller and recreating it fixes the issue.

The influx image was built with a custom image to support data persistence upon container recreation. This is the docker file used to build the image. My question is will clustering help with this issue, and if so, what is proper procedure for running influx in a cluster?

FROM ubuntu:14.04

RUN apt-get install -y curl

# Install InfluxDB
RUN curl -s -o /tmp/influxdb_latest_amd64.deb https://s3.amazonaws.com/influxdb/influxdb_0.9.0_amd64.deb && \
  dpkg -i /tmp/influxdb_latest_amd64.deb && \
  rm /tmp/influxdb_latest_amd64.deb && \
  rm -rf /var/lib/apt/lists/*

# Admin server
EXPOSE 8083

# HTTP API
EXPOSE 8086

WORKDIR /opt/influxdb/

CMD ./influxd -config /etc/opt/influxdb/influxdb.conf

Replication controller:

{
   "kind":"ReplicationController",
   "apiVersion":"v1beta3",
   "metadata":{
      "name":"dev-influx",
      "labels":{
         "name":"influx"
         "function":"db"
      }
   },
   "spec":{
      "replicas":1,
      "selector":{
         "name":"influx"
      },
      "template":{
         "metadata":{
            "labels":{
               "name":"influx",
               "function":"db"
            }
         },
         "spec":{
            "containers":[
               {
                  "name":"influx",
                  "image":"influx:0.9.0",
                  "volumeMounts":[
                     {
                        "mountPath":"/var/opt/influxdb/",
                        "name":"dev-disk"
                     }
                  ],
                  "ports":[
                     {
                        "containerPort":8083,
                        "protocol":"TCP"
                     },
                     {
                        "containerPort":8086,
                        "protocol":"TCP"
                     }
                  ]
               }
            ],
            "volumes":[
               {
                  "name":"dev-disk",
                  "gcePersistentDisk": {
                     "pdName":"dev-disk",
                     "fsType":"ext4",
                     "readOnly":false
                  }
               }
            ]
         }
      }
   }
}

marcospedreiro avatar Jul 21 '15 18:07 marcospedreiro

Mailing list thread here. Closing this issue until there's more evidence this is an InfluxDB issue.

Very much seems like a permissions bug in GKE/GCE.

gunnaraasen avatar Jul 21 '15 20:07 gunnaraasen