mineshaftgap / d4m-nfs

Docker for Mac with NFS for performance improvements over osxfs
296 stars 26 forks source link

Running d4m-nfs.sh gives something wrong with /etc/exports file error. #38

Closed TheDagger closed 7 years ago

TheDagger commented 7 years ago

The error I get is something is wrong with your /etc/exports file

Here is attached image of the error I get.

screen shot 2017-03-08 at 8 21 59 am

  1. screenshot of Docker for Mac's Preferences -> File Sharing

screen shot 2017-03-08 at 8 21 00 am

  1. attachment of d4m-nfs/etc/d4m-nfs-mounts.txt

/Users/josephastrahan:mnt:0:0

  1. attachment of /tmp/d4m-mount-nfs.sh ?? (I don't think I need this right? I'm using docker-compose.yml files)

  2. attachment of /tmp/d4m-nfs-mounts.txt

screen shot 2017-03-08 at 8 56 45 am

  1. attachment of /etc/exports

-e # d4m-nfs exports

"/Users/josephastrahan" -alldirs -mapall=501:20 localhost

TheDagger commented 7 years ago

My ultimate goal is to get my docker-compose file to work where I can just docker-compose up -d and it works as usual.

Here is my docker compose file

version: "2"
services:
    dblive:
        image: mysql:5.5.52
        volumes:
            - ./db_data_live:/var/lib/mysql
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 1234
            MYSQL_DATABASE: distribution_live
            MYSQL_USER: adminlive
            MYSQL_PASSWORD: 1234
    dbdev:
        image: mysql:5.5.52
        volumes:
            - ./db_data_dev:/var/lib/mysql
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: 1234
            MYSQL_DATABASE: distribution_dev
            MYSQL_USER: admindev
            MYSQL_PASSWORD: 1234

    phpmyadmin:
        depends_on:
            - dblive
            - dbdev
        image: phpmyadmin/phpmyadmin
        environment:
            PMA_ARBITRARY : 1
        restart: always
        ports:
            - "8081:80"

    web:
        build: ./
        depends_on:
            - dblive
            - dbdev
        volumes:
            - ./web:/var/www
            - ./config/custom.php.ini:/etc/php5/apache2/conf.d/custom.php.ini
            - ./logs/apache_error.log:/var/log/apache2/error.log
            - ./logs/apache_access.log:/var/log/apache2/access.log
            - ./config/apache_default.conf:/etc/apache2/sites-available/000-default.conf
            - ./config/apache_default-ssl.conf:/etc/apache2/sites-available/default-ssl.conf
            - ./config/ssl/apache.key:/etc/apache2/ssl/apache.key
            - ./config/ssl/apache.crt:/etc/apache2/ssl/apache.crt
            - ./web/public_html/livesite:/app
            - ./web/public_html/devsite:/appdev
        restart: always
        ports: 
            #Standard HTTP Port
            - "80:80"
            #Below allows access to local computer from outside ports
            - "8080:80"
            #SSH Port
            - "443:443"
            #Below allows access to local computer from outside ports
            - "4443:443"
TheDagger commented 7 years ago

If it helps here is an attachment to the path to my project. I am sharing the Users folder which is good enough right?

screen shot 2017-03-08 at 9 00 06 am

if-kenn commented 7 years ago

@TheDagger please edit your /etc/exports file and please change:

-e # d4m-nfs exports

to be:

# d4m-nfs exports

Note you editor will either need your password or you will need to use sudo.

if-kenn commented 7 years ago

You should allow the program to be run as intended (#!/bin/bash) instead of forcing it through sh like you did above. I have added that to the README.

TheDagger commented 7 years ago

To run in bash type /bin/bash d4m-nfs.sh, this seems to actually get this step to work now :). Awesome :). I was stuck on this for hours. Now to see if everything else works :).

TheDagger commented 7 years ago

Alright I got it all to work, some things to note for other users out there. I changed my d4m-nfs-mounts.txt file to this.

/Users:/Users:0:0
/Volumes:/Volumes
/private:/private

By doing this and adding the 0:0 it will allow connections on all ports and most importantly it will allow you to use docker-compose up -d with relative paths as if nothing had changed. It works great and super fast now. Thanks for this!

if-kenn commented 7 years ago

@TheDagger glad to hear that it is working now, I will close this issue.

FYI, you don't have to do /bin/bash d4m-nfs.sh since that is again forcing a specific shell (which happens to be the right one). You actually want to run ./d4m-nfs.sh which uses the Shebang for what shell should run it.

TheDagger commented 7 years ago

Thanks for letting me know, I created a nice step by step guide of how I did it for other users. I'll add this change in there tonight or tomorrow. Thanks!

http://stackoverflow.com/questions/38168130/docker-on-osx-slow-volumes/42679301#42679301

It includes pictures and everything :)

if-kenn commented 7 years ago

@TheDagger can you please update your post on Github to remove the mounts /Volumes and /private per: https://github.com/IFSight/d4m-nfs/commit/45f1628be62f91c5c7aaff9a97de931f5b5679fb