0

私のコメントで答えました。自分の質問に答えることができません。したがって、コメントの答え。 -----------------------*----------------------------

私が直面している nfs ボリューム マウントの問題を解決してください。

ホストLinux(ubuntu 14.04サーバー)にマウントしているfreenasサーバーからnfsファイル共有をセットアップしました

mount -t nfs -o proto=tcp xxx.xxx.x.xxx:/mnt/freenas/nmedia /mnt/media

/mnt/mediaLinuxホストには、Oracle virtualbox(4.3)がインストールされており、 kodi-xbmcをインストールしたホスト(ubuntu 14.04サーバー)からの共有フォルダーを持つLinux virtualboxがあります。この仮想ボックスでは、次のバージョンの詳細をドッカーしました。

root@kodixbmc:~# docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

次の起動スクリプトを使用して、ホストから仮想ボックスに共有フォルダーをマウントしました。エントリは次のとおり/etc/rc.localです。

#!/bin/bash
echo 'Mounting Share folder to /mnt/Share'
`sudo mount -t vboxsf -o uid=$UID,gid=root media /mnt/media`

/mnt/media/mysql次の実行コマンドを使用して、 を指す mysql コンテナを実行したかったのです。

docker run -d --privileged --name=mysql -v /mnt/media/mysql/data:/var/lib/mysql -v /mnt/media/mysql/logs:/var/log/mysql mgmttools:443/phani/mysql:latest

経由でターミナルに接続しようとすると、Mysql デーモンが起動しません。

docker run -it --privileged --name=mysql -v /mnt/media/mysql/data:/var/lib/mysql -v /mnt/media/mysql/logs:/var/log/mysql mgmttools:443/phani/mysql:latest /bin/bash

次に、ログファイルに書き込むことができるmysqldを自分で実行し/usr/bin/mysqld_safeます。ログファイルの内容は次のとおりです

151006 11:02:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151006 11:02:19 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
151006 11:02:19 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
151006 11:02:19 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
151006 11:02:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
151006 11:02:19 InnoDB: The InnoDB memory heap is disabled
151006 11:02:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151006 11:02:19 InnoDB: Compressed tables use zlib 1.2.8
151006 11:02:19 InnoDB: Using Linux native AIO
151006 11:02:19 InnoDB: Initializing buffer pool, size = 128.0M
151006 11:02:20 InnoDB: Completed initialization of buffer pool
151006 11:02:20  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
151006 11:02:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
4

1 に答える 1

0

ボリューム マウント関連の問題の経験則は、ファイル サーバー ユーザーのユーザー ID とグループ ID と、docker コンテナーでプロセスを実行しているキー ユーザーの ID を同期することです。docker コンテナーの mysql ユーザーと mysql グループの uid と gid を freenas ユーザーの uid と gid と同期することで、問題を解決できます。

于 2015-11-13T17:21:24.430 に答える