3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DockerでMariaDB 10.4(Mroongaプラグイン有効化)を起動時にログファイルの場所も変更してみる

3
Posted at

環境

Windows 10 Pro Version 1903 (OS build 18362)
Docker Desktop
 Engine: 19.03.4
 Compose: 1.24.1

docker-composeインストール・・・PowerShellを管理者権限で実行

PS C:\WINDOWS\system32> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
PS C:\WINDOWS\system32> Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe

MariaDB 10.4.5 + Mroongaプラグイン有効化のDockerイメージ
kazaoki/mariadb-mroonga

ファイル

docker-compose.yml
version: "3.7"
services:
  mariadb:
    container_name: mariadb
    image: kazaoki/mariadb-mroonga:10.4
    environment:
      MYSQL_ROOT_PASSWORD: test
    ports:
      - 3306:3306
    volumes:
      - ./sql/mroonga-log.sql:/docker-entrypoint-initdb.d/mroonga-log.sql
./sql/mroonga-log.sql
SET GLOBAL mroonga_log_file = "/var/log/mysql/mroonga.log";
SET GLOBAL mroonga_query_log_file = "/var/log/mysql/mroonga-query.log";

動作確認

$ docker-compose up -d
$ docker exec -it mariadb bash
$ cat /var/log/mysql/mroonga.log

2019-11-16 13:16:12.976751|n|042d8700|log file is changed: <groonga.log> -> </var/log/mysql/mroonga.log>
2019-11-16 13:16:12.976928|n|042d8700|query log is enabled: </var/log/mysql/mroonga-query.log>
2019-11-16 13:16:14.352656|n|0d48b540|mroonga 7.07 deinit
2019-11-16 13:16:14.353231|n|0d48b540|grn_fin (0)

$ cat /var/log/mysql/mroonga-query.log

2019-11-16 13:16:12.976964|0x7fafb17f5f40| query log will be closed: </var/log/mysql/mroonga-query.log>
2019-11-16 13:16:12.977011|0x7fafb17f5f40| query log is opened: </var/log/mysql/mroonga-query.log>
2019-11-16 13:16:14.353102|0x7fafb17a2040| query log will be closed: </var/log/mysql/mroonga-query.log>
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?