Closed siddharth-ub closed 5 years ago
Hi @siddharth-ub
Could you provide your marathon.json for the CrateDB container?
CrateDB is run as user crate
inside the Docker container, that is why the /data
path (inside container) needs to be owned by crate
.
When you mount a volume of the host to the Docker container, the Docker container will change the permissions of the host file directory that is mounted. Since uid of users inside and outside of the Docker container are different, you probably won't be able read/write on that directory with a crate
user on the host system.
Hi @chaudum ,
Please find the json below :
{
"id": "/cratem1",
"cmd": null,
"cpus": 2,
"mem": 4096,
"disk": 10240,
"instances": 0,
"acceptedResourceRoles": [
"*"
],
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/crate/data",
"hostPath": "data",
"mode": "RW"
},
{
"containerPath": "data",
"mode": "RW",
"persistent": {
"size": 10000,
"type": "root",
"constraints": []
}
}
],
"docker": {
"image": "registry.symphoni.io/crate/cratem1:v84",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 4200,
"hostPort": 0,
"servicePort": 10288,
"protocol": "tcp",
"labels": {}
},
{
"containerPort": 4301,
"hostPort": 0,
"servicePort": 10285,
"protocol": "tcp",
"labels": {}
},
{
"containerPort": 5432,
"hostPort": 0,
"servicePort": 10289,
"protocol": "tcp",
"labels": {}
}
],
"privileged": false,
"parameters": [
{
"key": "user",
"value": "crate"
}
],
"forcePullImage": false
}
},
"env": {
"bo.soa.config.enable-message-builder": "false",
"bo.soa.config.orm-endpoint": "orm",
"bo.custom.security-crypto-url": "https://securitycrypto.invent.symphoni.io/KeyExchange/SecretKey",
"spring.datasource.url": "jdbc:com.nuodb://x.x.x.x:48004/pass_Application?schema=BOSUITE",
"bo.soa.config.env": "PRODUCTION",
"security.oauth2.resource.user-info-uri": "https://identityserver.invent.symphoni.io/",
"bo.custom.environment": "PRODUCTION",
"bo.custom.database-url": "jdbc:com.nuodb://x.x.x.x:48004/pass_Application?schema=BOSUITE",
"bo.soa.config.enable-middle-tier": "false",
"bo.soa.config.service-url": "https://serviceurl.invent.symphoni.io/serviceURL/",
"bo.soa.security.secret-key-url": "https://securitycrypto.invent.symphoni.io/KeyExchange/SecretKey",
"bo.custom.orm-name": "orm"
},
"healthChecks": [
{
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"delaySeconds": 15,
"command": {
"value": "bash -c \\\"</dev/tcp/$HOST/$PORT0\\\""
},
"protocol": "COMMAND"
}
],
"labels": {
"HAPROXY_0_MODE": "http",
"HAPROXY_GROUP": "external",
"HAPROXY_1_PORT": "4301",
"HAPROXY_2_PORT": "5432",
"HAPROXY_1_MODE": "tcp",
"HAPROXY_2_MODE": "tcp",
"HAPROXY_0_VHOST": "cratem1.invent.symphoni.io"
},
"portDefinitions": [
{
"port": 10288,
"protocol": "tcp",
"name": "default",
"labels": {}
},
{
"port": 10285,
"protocol": "tcp",
"labels": {}
},
{
"port": 10289,
"protocol": "tcp",
"labels": {}
}
],
"uris": [
"http://dockerconfig.invent.symphoni.io/public/docker.tar.gz"
],
"fetch": [
{
"uri": "http://dockerconfig.invent.symphoni.io/public/docker.tar.gz",
"extract": true,
"executable": false,
"cache": false
}
],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
}
}
I'm not too familiar with Mesos, but from reading the documentation, a MOUNT
disk would be more suitable for CrateDB persistent storage: http://mesos.apache.org/documentation/latest/multiple-disk/#mount-disks
A Mount disk is an auxiliary disk resource provided by the operator. This cannot be carved up into smaller chunks by frameworks. This lack of flexibility allows operators to provide assurances to frameworks that they will have exclusive access to the disk device. Common uses for this kind of disk include database storage, write-ahead logs, or other performance-critical applications.
Make sure the mount path is read/writable by the Mesos role that is running CrateDB.
Looks like the question has been answered and there hasn't been any feedback to it. So I'm closing this.
Please re-open if this is still an issue.
Hi, I am trying to use this image in Marathon along with local persistence volumes on DCOS. Since the data folder for crate is chown-ed to crate user , i am unable to read/write to the persistent storage volume once the container is up. The error log :
https://github.com/crate/docker-crate/blob/cc32be338458ce5828e442b1f5cca269bd0ee774/docker-entrypoint.sh#L10