eZ Platform Discussions

eZ Launchpad - Avoid overloading the system partition


#1

By default docker stores all on /var/lib/docker/
Which will soon fill the partition.

Sys. de fichiers   Taille Utilisé Dispo Uti% Monté sur
root                  29G     29G   0G  100% /
home                 396G    293G   83G  78% /home

Solution :

# Se connecter en root
sudo -s

# Créer un dossier dans /home
mkdir /home/me/.docker

# Copier le contenu de /var/lib/docker/ dedans.
cp -r /var/lib/docker/* /home/me/.docker/
# Cette opération peut être longue.

# Localiser le fichier de configuration :
systemctl status docker
# Loaded: loaded (/lib/systemd/system/docker.service
vim /lib/systemd/system/docker.service
# Ajouter le chemin du nouveau dossier dans le ExecStart
## Avant :
# ExecStart=/usr/bin/dockerd -H fd://
## Après
# ExecStart=/usr/bin/dockerd -g /home/me/.docker -H fd://

# On reload le démon !
systemctl daemon-reload

# Enfin on redémare docker et on vérifie que tous va bien.
systemctl start docker
systemctl status docker

# Pour finir on se débarase du /var/lib/docker
rm -rf /var/lib/docker

#2

Arf,
I hope my previous post is a trick to share with the community. But actually I have a mistake…

First I have a right pb on /tmp/ezplatormcache/
bp easy to adjust with a stroke of 777.

But after that I have a RuntimeException : Database error
I connect in the docker engine and I notice that mysql does not connect.

mysql

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

And indeed, the mysql machine did not start.

docker ps -a
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS                     PORTS                                          NAMES
d120cb96f329        plopix/docker-varnish5                  "/start.bash"            7 seconds ago       Up 6 seconds               6082/tcp, 0.0.0.0:35082->80/tcp                me_varnish_1
da49cd5f5d2d        solr:6.6                                "/entrypoint.bash"       8 seconds ago       Exited (1) 5 seconds ago                                                  me_solr_1
e70bd0c21ad3        nginx:stable-alpine                     "/entrypoint.bash"       8 seconds ago       Up 6 seconds               0.0.0.0:35080->80/tcp, 0.0.0.0:35081->81/tcp   me_nginx_1
9de88ff2ad86        redis:latest                            "docker-entrypoint.s…"   8 seconds ago       Up 7 seconds               6379/tcp                                       me_redis_1
b447dda6070e        schickling/mailcatcher                  "mailcatcher --no-qu…"   9 seconds ago       Up 4 seconds               1025/tcp, 0.0.0.0:35180->1080/tcp              me_mailcatcher_1
a99231209d5d        rediscommander/redis-commander:latest   "/home/redis-command…"   9 seconds ago       Up 5 seconds               0.0.0.0:35083->8081/tcp                        me_redisadmin_1
094ee6f7197f        adminer:latest                          "entrypoint.sh docke…"   9 seconds ago       Up 8 seconds               0.0.0.0:35084->8080/tcp                        me_adminer_1
77d0bd99b6f3        blackfire/blackfire                     "blackfire-agent"        9 seconds ago       Exited (1) 8 seconds ago                                                  me_blackfire_1
59a17133f703        me_engine                         "/entrypoint.bash ph…"   9 seconds ago       Up 8 seconds               9000/tcp                                       me_engine_1
e8af5153b32a        mariadb:10.1                            "docker-entrypoint.s…"   9 seconds ago       Exited (1) 6 seconds ago                                                  me_db_1

I’m trying an admin access. But he too can’t write in /tmp
http://localhost:35084/

docker logs me_db_1
2018-05-02 12:42:44 140116539217856 [Note] mysqld (mysqld 10.1.31-MariaDB-1~jessie) starting as process 1 ...
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: The InnoDB memory heap is disabled
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: Using Linux native AIO
2018-05-02 12:42:45 140116539217856 [Note] InnoDB: Using SSE crc32 instructions
2018-05-02 12:42:45 140116539217856 [ERROR] mysqld: Can t create/write to file '/tmp/ib6LwvxR' (Errcode: 13 "Permission denied")
2018-05-02 12:42:45 7f6f6c8c17c0  InnoDB: Error: unable to create temporary file; errno: 13
2018-05-02 12:42:45 140116539217856 [ERROR] Plugin 'InnoDB' init function returned error.
2018-05-02 12:42:45 140116539217856 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-05-02 12:42:45 140116539217856 [Note] Plugin 'FEEDBACK' is disabled.
2018-05-02 12:42:45 140116539217856 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-05-02 12:42:45 140116539217856 [ERROR] Aborting

If I test a new installation I still have write pb in /tmp

cd docker/test2
~/ez init
# standard
# ...
Installation eZ Platform (ezsystems/ezplatform:2.*:clean) in the container
PHP temp directory (/tmp) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini
# ...
> eZ\Bundle\EzPublishCoreBundle\Composer\ScriptHandler::installWelcomeText

      ________      ____    ___             __       ___         
     /\_____  \    /\  _`\ /\_ \           /\ \__  /'___\ 
   __\/____//'/'   \ \ \_\ \//\ \      __  \ \ ,_\/\ \__/  ___   _ __    ___ ___
 /'__`\   //'/'     \ \ ,__/ \ \ \   /'__`\ \ \ \/\ \ ,__\/ __`\/\`'__\/' __` __`\  
/\  __/  //'/'___    \ \ \/   \_\ \_/\ \L\.\_\ \ \_\ \ \_/\ \L\ \ \ \/ /\ \/\ \/\ \ 
\ \____\ /\_______\   \ \_\   /\____\ \__/.\_\ \__\ \_\ \____/\ \_\ \ \_\ \_\ \_\
 \/____/ \/_______/    \/_/   \/____/\/__/\/_/ \/__/ \/_/ \/___/  \/_/  \/_/\/_/\/_/


Welcome to eZ Platform!

Quick Install:
    $  export SYMFONY_ENV="dev"
    $  php bin/console ezplatform:install <type>
    $  php bin/console server:run

Note:
- "ezplatform:install" has different installer <type>s depending on your install, run command with --help to see your options.
- Instructions above assume the CLI user you execute these commands with is the same one that extracted/installed the software,
  otherwise see install instructions for directory permissions.
- The last command will give you the url to the frontend of the installation, add "/admin" to reach backend.


For full install instructions, including setting up full web server & directory permissions, see install instructions in INSTALL.md
or README.md.

...........................................................................................................................................................
                                                                                                                                                                                                             

The installation script does not stop making small points… I’m afraid he’ll never stop!


#3

@Plopix, something for you to look at?


#4

Hy @robinmuilwijk,

I find a solution :slight_smile:

First do a big cleanup

ez docker:down

docker rm -f $(docker ps -aq)
docker system prune -a
docker volume rm $(docker volume ls -q)

(Until then I didn’t put option -a in the command: docker system prune)

And then it starts clean!

ez docker:up

(it takes a little bit of time because it re-downloads more stuff. )


But in the meantime I also created the /etc/docker/daemon.json file with this in it:

{
  "storage-driver": "overlay2"
}

But I don’t think it has an impact.