Git Product home page Git Product logo

Comments (5)

if-kyle avatar if-kyle commented on August 15, 2024

If I follow correctly, the files on your mac (not in the container) are at /tmp. The /tmp directory is deleted anytime a reboot happens on the host (mac) system. This is the same as a linux box. This is not related to d4m-nfs. I would suggest moving the directory location else where on the mac.

from d4m-nfs.

leolandotan avatar leolandotan commented on August 15, 2024

Thanks for your feedback @if-kyle !

So my Docker shared folder would be something different from "/tmp" like "/mynewtmp". Then my docker-compose.yml mysql service would look like:

  db:
    build: docker/mysql
    volumes:
      - /mynewtmp/docker/project1/mysql:/var/lib/mysql
    environment:

Is this correct?

Is a volume declaration of ./data/mysql:/var/lib/mysql for my mysql service not possible? Like just placing it inside my project and the same for my other projects?

Thanks!

from d4m-nfs.

if-kenn avatar if-kenn commented on August 15, 2024

@leolandotan we don't use relative paths here, but it sounds like it works fine for others, see: #5

from d4m-nfs.

leolandotan avatar leolandotan commented on August 15, 2024

Hi @if-kenn !

Thanks for the link. My apologies for being noob here.

Here are my configurations so far that worked:
d4m-nfs/etc/d4m-nfs-mounts.txt

/Users:/Users:0:0

Docker > Preferences > File Sharing

/tmp

/etc/exports

# d4m-nfs exports

"/Users" -alldirs -mapall=0:0 localhost

/tmp/d4m-mount-nfs.sh

ln -nsf /tmp/d4m-apk-cache /etc/apk/cache
apk update
apk add nfs-utils sntpc
rpcbind -s > /dev/null 2>&1

DEFGW=$(ip route|awk '/default/{print $3}')
FSTAB="\n\n# d4m-nfs mounts\n"

if true && ! $(grep ':/mnt' /tmp/d4m-nfs-mounts.txt > /dev/null 2>&1); then
  mkdir -p /mnt

  FSTAB="${FSTAB}${DEFGW}:/Users/leotan /mnt nfs nolock,local_lock=all 0 0"
fi

if [ -e /tmp/d4m-nfs-mounts.txt ]; then
  while read MOUNT; do
    DSTDIR=$(echo "$MOUNT" | cut -d: -f2)
    mkdir -p ${DSTDIR}
    FSTAB="${FSTAB}\n${DEFGW}:$(echo "$MOUNT" | cut -d: -f1) ${DSTDIR} nfs nolock,local_lock=all 0 0"
  done < /tmp/d4m-nfs-mounts.txt
fi

if ! $(grep "d4m-nfs mounts" /etc/fstab > /dev/null 2>&1); then
    echo adding d4m nfs config to /etc/fstab:
    echo -e $FSTAB | tee /etc/fstab
else
    echo d4m nfs mounts already exist in /etc/fstab
fi

sntpc -i 10 ${DEFGW} &

sleep .5
mount -a
touch /tmp/d4m-done

/tmp/d4m-nfs-mounts.txt

/Users:/Users:0:0

docker-compose.yml

...
  mysql:
    image: mysql:5.7
    volumes:
      - ./data/mysql:/var/lib/mysql
...

I'm using:

  • Docker: Version 17.03.1-ce-mac12 (17661) Channel: stable
  • d4m-nfs: Latest as of May 19, 2017

Fresh Drupal site installation loads pretty well.

Is there a way to know that the site is really using d4m-nfs like d4m-nfs may be running but the my Docker project isn't using it or as long as d4m-nfs started with no error my project is working with d4m-nfs already?

Thanks!

from d4m-nfs.

if-kyle avatar if-kyle commented on August 15, 2024

From the docker-compose.yml, as long as the ./data/mysql is not in the /tmp directory of your mac, then you are in fact using d4m and not the default (slow) osxfs file system.

You could speed test this by modifying Docker > Preferences > File Sharing and removing /tmp and replacing it with the location of ./data/mysql (absolute path), and then do NOT run d4m script before starting your containers.

from d4m-nfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.