Giter Site home page Giter Site logo

docker's Issues

mroonga_command() 等の関数が初期状態で利用できない

DBのボリュームを削除して初期化した状態で起動します。

docker volume rm hoge

docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=1 --rm -v hoge:/var/lib/mysql:nocopy groonga/mroonga:mysql-8.0-latest

起動した mysql に接続して mroonga_command() を呼び出そうとすると No database selected というエラーになりました。

mysql> SELECT mroonga_command('status');
ERROR 1046 (3D000): No database selected

/usr/share/mroonga/update.sql に CREATE FUNCTION で mroonga_command() 関数を登録する処理が書かれてることがわかったので、実行してみると mroonga_command() 関数が使えるようになりましたが、これは意図的な動作でしょうか?

mysql> \. /usr/share/mroonga/update.sql
Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

mysql> SELECT mroonga_command('status');
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mroonga_command('status')





                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 0x7B22616C6C6F635F636F756E74223A3732332C22737461727474696D65223A313635373736333036302C2273746172745F74696D65223A313635373736333036302C22757074696D65223A3134312C2276657273696F6E223A2231322E302E34222C226E5F71756572696573223A302C2263616368655F6869745F72617465223A302E302C22636F6D6D616E645F76657273696F6E223A312C2264656661756C745F636F6D6D616E645F76657273696F6E223A312C226D61785F636F6D6D616E645F76657273696F6E223A332C226E5F6A6F6273223A302C226665617475726573223A7B226E666B63223A747275652C226D65636162223A747275652C226D6573736167655F7061636B223A747275652C226D72756279223A747275652C226F6E69676D6F223A747275652C227A6C6962223A747275652C226C7A34223A747275652C227A7374616E64617264223A747275652C226B7175657565223A66616C73652C2265706F6C6C223A747275652C22706F6C6C223A66616C73652C2272617069646A736F6E223A747275652C226170616368655F6172726F77223A747275652C22787868617368223A66616C73657D2C226170616368655F6172726F77223A7B2276657273696F6E5F6D616A6F72223A382C2276657273696F6E5F6D696E6F72223A302C2276657273696F6E5F7061746368223A302C2276657273696F6E223A22382E302E30227D2C226D656D6F72795F6D61705F73697A65223A3131373737323238387D |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

レスポンスが16進数になっているのは不思議ですが、デコードすると読むことはできました。

No version supports MariaDB

I can't find any mroonga images that support MariaDB. The official installation methods of MariaDB and mroonga have encountered obvious problems. No more information could be found

mysql-8.0.29-12.04 が期待通りに動作しない

こんにちは。
mysql-8.0.29-12.04 を試したところ、通常は初回起動時に行われる設定が行われず、mroonga が有効になりませんでした。

$ docker run --rm groonga/mroonga:mysql-8.0.29-12.04
2022-06-22 04:21:34+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.
2022-06-22 04:21:34+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-06-22 04:21:34+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.

通常であればデータベースが存在しないため、初期化の処理が走り、そこで「MYSQL_ROOT_PASSWORD が設定されていない」など、いろんなチェックにひっかかるはずなのですが、何も表示されません。

調べたところ、mysql-8.0.29-12.04 の Dockerfile で mysql-community-8.0-mroonga がインストールされたときに、すでに /var/lib/mysql の中身が作成されていました。
このため新しい volume を /var/lib/mysql に設定しても、もともとの /var/lib/mysql の内容が volume にコピーされるので初期設定の処理が実行されませんでした。

$ docker run --rm -v vol1:/var/lib/mysql groonga/mroonga:mysql-8.0.29-12.04

nocopy を付けるとコピーが行われないのでうまく動作しました。(これを調べるまで、デフォルトでコピーされることを知りませんでした...)

$ docker run --rm -v vol1:/var/lib/mysql:nocopy groonga/mroonga:mysql-8.0.29-12.04

また、古いバージョンのタグの mysql-8.0.28-12.02 は正常に動作しましたが、MySQL のバージョンが 8.0.28 ではなく、5.7.37 でした。

Test for MySQL 5.6 series fails when MySQL > 8.0 is installed.

Because mysqladmin client has incompatibility of handling shutdown sub-command between 5.6 and 8.0.

        ok 5 - Exist table which has been created at last running
mysqladmin: shutdown failed; error: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'shutdown' at line 1'
        not ok 6 - Restore mounted directorie's owner
        #   Failed test 'Restore mounted directorie's owner'
        #   at ./build.pl line 176.
        #     Structures begin differing at:
        #          $got->[0] = '1000'
        #     $expected->[0] = '27'
        1..6
        # Looks like you failed 1 test of 6.
    not ok 5 - Running with re-use mounted volume
    #   Failed test 'Running with re-use mounted volume'
    #   at ./build.pl line 177.
    1..5
    # Looks like you failed 1 test of 5.
not ok 1 - Build and Test /home/yoku0825/git/mroonga_docker/test/../Dockerfile/mysql5643_mroonga900
#   Failed test 'Build and Test /home/yoku0825/git/mroonga_docker/test/../Dockerfile/mysql5643_mroonga900'
#   at ./build.pl line 178.

Reference(Japanese only)
日々の覚書: MySQL 5.7, MySQL 8.0 でちょっとだけmysqladmin shutdownが変わる

About my.cnf permissions

お世話になっております。日本語で失礼します。

Windows の Vagrant 上において、 docker-compose で独自の my.cnf をコピーしてビルドした際に、my.cnf のパーミッションが 777 となり下記のエラーが発生します。

Warning: World-writable config file '/etc/my.cnf' is ignored

当プロジェクトのコンテナが問題ということではなく、他のMySQL系のコンテナでも同様に発生する問題ではあります。
また、Windows 限定の問題であり、Mac や Linux など他の OS では発生しない問題です。

当方の環境では、下記のように my.cnf のパーミッションを 644 に設定し直す docker-compose 用の Dockerfile を用意して問題を回避しています。

ARG MROONGA_VERSION=latest
FROM groonga/mroonga:${MROONGA_VERSION}

LABEL maintainer="NABOO Inc."

COPY my.cnf /etc/my.cnf
RUN chmod 644 /etc/my.cnf

ご報告まで。

[Question] What's the proper way to initialize DB automatically?

I want to initialize the schema of Mroonga DB with SQL files. MySQL and PostgreSQL images read /docker-entrypoint-initdb.d directory on the first boot and if there are .sql files there, they automatically run the files. I want to do the same thing with this Mroonga image. Is there any way to achieve that?

Change the default timezone, will cause an error.

Hello, @yoku0825

Change the default timezone, will cause an error.

Mroonga container is started with the following configuration using docker-compose.

Dockerfile

ARG MROONGA_VERSION=latest
FROM groonga/mroonga:${MROONGA_VERSION}

LABEL maintainer="NABOO Inc. <[email protected]>"

COPY my.cnf /etc/my.cnf

Customized my.cnf

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[client]
default-character-set=utf8mb4

[mysql]
default-character-set=utf8mb4

[mysqldump]
default-character-set=utf8mb4

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

#log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

### Added by yoku0825
character_set_server= utf8mb4
#loose-validate_password   = OFF

### Added by naboo-nishihara
skip-character-set-client-handshake
collation-server=utf8mb4_general_ci
init-connect=SET NAMES utf8mb4
innodb_ft_min_token_size=1
ft_min_word_len=1
ngram_token_size=1
default-time-zone='Asia/Tokyo'

Mroonga container is exited by the following error.

$ docker-compose logs mroonga
Attaching to laradock_mroonga_1
mroonga_1              | 2018-10-02T01:44:27.691483Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mroonga_1              | 2018-10-02T01:44:27.693723Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.23) starting as process 13 ...
mroonga_1              | 2018-10-02T01:44:27.698246Z 0 [Note] InnoDB: PUNCH HOLE support available
mroonga_1              | 2018-10-02T01:44:27.698269Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mroonga_1              | 2018-10-02T01:44:27.698277Z 0 [Note] InnoDB: Uses event mutexes
mroonga_1              | 2018-10-02T01:44:27.698284Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
mroonga_1              | 2018-10-02T01:44:27.698291Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
mroonga_1              | 2018-10-02T01:44:27.698299Z 0 [Note] InnoDB: Using Linux native AIO
mroonga_1              | 2018-10-02T01:44:27.698786Z 0 [Note] InnoDB: Number of pools: 1
mroonga_1              | 2018-10-02T01:44:27.699053Z 0 [Note] InnoDB: Using CPU crc32 instructions
mroonga_1              | 2018-10-02T01:44:27.701648Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mroonga_1              | 2018-10-02T01:44:27.713776Z 0 [Note] InnoDB: Completed initialization of buffer pool
mroonga_1              | 2018-10-02T01:44:27.717205Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mroonga_1              | 2018-10-02T01:44:27.729241Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
mroonga_1              | 2018-10-02T01:44:27.747822Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mroonga_1              | 2018-10-02T01:44:27.748056Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mroonga_1              | 2018-10-02T01:44:27.784621Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mroonga_1              | 2018-10-02T01:44:27.785699Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
mroonga_1              | 2018-10-02T01:44:27.785719Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
mroonga_1              | 2018-10-02T01:44:27.786306Z 0 [Note] InnoDB: Waiting for purge to start
mroonga_1              | 2018-10-02T01:44:27.836495Z 0 [Note] InnoDB: 5.7.23 started; log sequence number 2589159
mroonga_1              | 2018-10-02T01:44:27.836988Z 0 [Note] Plugin 'FEDERATED' is disabled.
mroonga_1              | 2018-10-02T01:44:27.836989Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mroonga_1              | 2018-10-02T01:44:27.839622Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181002 10:44:27
mroonga_1              | 2018-10-02T01:44:27.852454Z 0 [Warning] unknown variable 'loose-validate_password=OFF'
mroonga_1              | 2018-10-02T01:44:27.853095Z 0 [Note] Salting uuid generator variables, current_pid: 13, server_start_time: 1538444667, bytes_sent: 0, 
mroonga_1              | 2018-10-02T01:44:27.853170Z 0 [Note] Generated uuid: 'b2d83e5a-c5e4-11e8-b2f0-0242ac130006', server_start_time: 3659176235683208, bytes_sent: 61363488
mroonga_1              | 2018-10-02T01:44:27.853187Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: b2d83e5a-c5e4-11e8-b2f0-0242ac130006.
mroonga_1              | 2018-10-02T01:44:27.855110Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
mroonga_1              | 2018-10-02T01:44:27.855383Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
mroonga_1              | 2018-10-02T01:44:27.855430Z 0 [Note] IPv6 is available.
mroonga_1              | 2018-10-02T01:44:27.855447Z 0 [Note]   - '::' resolves to '::';
mroonga_1              | 2018-10-02T01:44:27.855557Z 0 [Note] Server socket created on IP: '::'.
mroonga_1              | 2018-10-02T01:44:27.867283Z 0 [ERROR] Fatal error: Illegal or unknown default time zone 'Asia/Tokyo'
mroonga_1              | 2018-10-02T01:44:27.867320Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
mroonga_1              | 2018-10-02T01:44:27.867417Z 0 [ERROR] Aborting

Question

If include the following code in the Dockerfile of this project, will not cause an error?

RUN /usr/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo > ~/timezone.sql && ¥
mysql -u root -p mysql < ~/timezone.sql

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.