Mac安装minio
Mac安装minio
本文介绍使用 mac 安装 MinIO。
所有软件安装优先参考官网:MinIO Object Storage for MacOS — MinIO Object Storage for MacOS
#使用 brew 安装 minio brew install minio/stable/minio #找到 minio tong ~ $ brew list minio /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio #进入 minio,发现是目录 tong ~ $ cd /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio cd: not a directory: /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio #进入 minio 上一级 tong ~ $ cd /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/ #ll查看 tong /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin (stable)$ ll total 211136 drwxr-xr-x@ 3 tong admin 96B Mar 27 09:06 . drwxr-xr-x@ 5 tong admin 160B Mar 27 09:09 .. -r-xr-xr-x@ 1 tong staff 103M Mar 27 06:54 minio #创建 data 存储目录 tong /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin (stable)$ mkdir data #给权限 tong /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin (stable)$ chmod +x data #启动 minio,报错 tong /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin (stable)$ MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=123456 ./minio server ./data --console-address ":9001" #指定 账号 密码 当前可执行文件 server 存储路径 端口 #密码不符合规范 ERROR Unable to validate credentials inherited from the shell environment: Invalid credentials > Please provide correct credentials HINT: Access key length should be at least 3, and secret key length at least 8 characters #修改后,重新启动成功 tong /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin (stable)$ MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=12345678 ./minio server ./data --console-address ":9001" Formatting 1st pool, 1 set(s), 1 drives per set. WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable. MinIO Object Storage Server Copyright: 2015-2024 MinIO, Inc. License: GNU AGPLv3 Version: RELEASE.2024-03-26T22-10-45Z (go1.21.8 darwin/arm64) API: http://192.168.0.46:9000 http://127.0.0.1:9000 RootUser: admin RootPass: 12345678 WebUI: http://192.168.0.46:9001 http://127.0.0.1:9001 RootUser: admin RootPass: 12345678 CLI: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart $ mc alias set 'myminio' 'http://192.168.0.46:9000' 'admin' '12345678' Docs: https://min.io/docs/minio/linux/index.html Status: 1 Online, 0 Offline. STARTUP WARNINGS: - The standard parity is set to 0. This can lead to data loss.
浏览器访问:http://localhost:9001/login,输入账号密码登录
附:后台运行 minio,指定文件位置,指定端口号,指定输出日志路径,以及一键启动 minio脚本。
后台执行minio命令
MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=12345678 \ nohup /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio \ server /Users/tong/Environment/minio/miniodata \ --console-address ":9001" > minio.log 2>&1 &
这段脚本是用来启动 Minio 服务器的。让我逐步解释它的含义:
- MINIO_ROOT_USER=admin:设置 Minio 服务器的根用户为 “admin”。
- MINIO_ROOT_PASSWORD=12345678:设置 Minio 服务器的根用户密码为 “12345678”。
- nohup:这是一个命令,用于在后台运行指定的命令,并且忽略挂起信号。
- /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio:指定 Minio 可执行文件的路径,用于启动 Minio 服务器。
- server /Users/tong/Environment/minio/miniodata:告诉 Minio 启动服务器模式,并指定数据存储目录为 “/Users/tong/Environment/minio/miniodata”。
- --console-address ":9001":设置 Minio 控制台的地址为 “:9001”,表示监听在本地 9001 端口上。
- > minio.log 2>&1:将标准输出(stdout)重定向到名为 “minio.log” 的文件中,并将标准错误输出(stderr)重定向到标准输出。这样可以将所有输出都记录到 “minio.log” 文件中。
- &:这个符号用于将整个命令放入后台运行。
综合起来,这个脚本的作用是以后台方式启动 Minio 服务器,使用指定的根用户和密码,数据存储目录为 “/Users/tong/Environment/minio/miniodata”,并将所有输出记录到名为 “minio.log” 的文件中。
将脚本保存为minio.sh文件,上传至服务器,给权限 744 或者 777,注意这里所有用到的文件夹和文件统一都要给读写权限,miniodata,minio.sh
tong ~/Environment $ vim minio.sh tong ~/Environment $ ./minio.sh tong ~/Environment $ sudo lsof -i:9001 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME minio 27608 tong 21u IPv6 0xd3a8cf22ccf4a4dd 0t0 TCP *:etlservicemgr (LISTEN) tong ~/Environment $ ps aux | grep minio tong 27663 0.0 0.0 408495824 1136 s006 R+ 11:09AM 0:00.00 grep --color=auto minio tong 27608 0.0 1.6 412458448 275712 s006 S 11:09AM 0:00.43 /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/minio server /opt/homebrew/Cellar/minio/RELEASE.2024-03-26T22-10-45Z_1/bin/data --console-address :9001
如果文档对您有帮助,或者有疑问,欢迎私信交流学习!~
免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理!
部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理!
图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们,邮箱:ciyunidc@ciyunshuju.com。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!