Linux 配置单机 minio 服务
Posted isea533
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux 配置单机 minio 服务相关的知识,希望对你有一定的参考价值。
为了在 gitlab-runner 中使用 cache,配置了一个 minio 服务用于存储缓存的中间文件。
参考官方文档
- 下载 minio 服务端
- 配置
/etc/default/minio
配置文件# 修改存储数据的路径 MINIO_VOLUMES="/tmp/minio/" # Use if you want to run MinIO on a custom port. MINIO_OPTS="--address :9000 --console-address :9001" # Root user for the server. MINIO_ROOT_USER=Root-User # Root secret for the server. MINIO_ROOT_PASSWORD=Root-Password
- 下载
minio.service
文件[Unit] Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] WorkingDirectory=/usr/local/ User=minio Group=minio ProtectProc=invisible EnvironmentFile=/etc/default/minio ExecStartPre=/bin/bash -c "if [ -z \\"$MINIO_VOLUMES\\" ]; then echo \\"Variable MINIO_VOLUMES not set in /etc/default/minio\\"; exit 1; fi" ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES # Let systemd restart this service always Restart=always # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=1048576 # Specifies the maximum number of threads this process can create TasksMax=infinity # Disable timeout logic and wait until process is stopped TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target # Built for $project.name-$project.version ($project.name)
注意
在2中,设置了一个 minio 的存储目录,在 3 中设置了用户和组,为了避免使用 root,添加下面的组和用户:sudo groupadd minio sudo useradd -g minio minio
然后设置 2 中目录的权限:
sudo chown -R minio:minio /xxxxx/data
- 启用和启动服务
systemctl enable minio.service systemctl start minio.service
- 访问:http://IP:9001
gitlab-runner 的 config.toml
配置
修改 cache 相关的配置:
[runners.cache]
Type = "s3"
Shared = true
[runners.cache.s3]
ServerAddress = "IP:9000"
AccessKey = "USER"
SecretKey = "PASSWORD"
BucketName = "gitlab-runner"
Insecure = true
以上是关于Linux 配置单机 minio 服务的主要内容,如果未能解决你的问题,请参考以下文章