mountpoint-s3 rpm 包

为了方便linux 系统使用mountpoint-s3包(centos)基于自己构建的二进制程序+fpm 制作了一个rpm 可以方便大家使用

参考构建处理

  • 命令
fpm -s dir -t rpm -n mountpoint-s3 --rpm-os linux -v v1.0.0_centos7 \
  ./mount-s3-centos=/usr/bin/mount-s3 \
  ./mountpoint.service=/usr/lib/systemd/system/mountpoints3.service \
  ./mountpoint.config=/etc/mountpoint/config
  • mountpoint.service
    使用了forking模式,默认mount-s3 挂载为后台任务
 
[Unit]
Description=mountpoint-s3 service
After=network.target
 
[Service]
EnvironmentFile=-/etc/mountpoint/config
ExecStart=/usr/bin/mount-s3  $OPTIONS
Type=forking
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
  • mountpoint.config
    启动配置,通过环境变量存储了s3 访问key 以及启动配置
 
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""
OPTIONS=" --endpoint-url http://127.0.0.1:9000  demoapp demoapp"

说明

rpm包我已经放到github了,实际使用主要就是进行/etc/mountpoint/config 配置的修改对于挂载点配置需要使用绝对路径
参考

 
AWS_ACCESS_KEY_ID="minio"
AWS_SECRET_ACCESS_KEY="minio123"
OPTIONS=" --endpoint-url http://127.0.0.1:9000 -l /opt/s3/logs  demoapp /opt/s3/demoapp"
 
 

参考资料

https://github.com/awslabs/mountpoint-s3
https://github.com/rongfengliang/mountpoint-s3-packages/releases/tag/v1.0.0

posted on 2023-03-27 16:07  荣锋亮  阅读(76)  评论(0编辑  收藏  举报

导航