minio使用

安装教程网址

https://min.io/docs/minio/linux/index.html

安装

安装方式
binary

配置默认账号密码
vi /etc/profile

export MINIO_ROOT_USER=minio
export MINIO_ROOT_PASSWORD=minio
cd /data
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo mv minio /usr/local/bin/
mkdir /data/minio
minio server /data/minio --console-address :9090

占用端口9000,9090

minio使用_第1张图片

看到这样子的显示,代表成功了

ui网址

http://127.0.0.1:9000

minio使用_第2张图片
minio使用_第3张图片

创建keys和buckets

java api参考

https://github.com/minio/minio-java

分布式参考文章

https://juejin.cn/post/7131692039493648414

4主机,每台主机4个磁盘

如何挂载磁盘参考文章
https://blog.csdn.net/chaogaoxiaojifantong/article/details/128123021

四台主机非别为
127.0.0.135、127.0.0.136、127.0.0.137、127.0.0.138

磁盘挂载目录为
/minio/disk1、/minio/disk2、/minio/disk3、/minio/disk4

minio安装步骤和上文一样

启动命令

账号密码配置,命令行输入

export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=admin123456

每台机子上启动该命令

nohup minio server --console-address 0.0.0.0:9001 http://127.0.0.13{5...8}:9000/minio/disk{1...4} &

然后登录可视化界面,4台机子都能登录进去就正常了

nginx代理集群

代理api和ui网址

   server {
        listen       8272;
                location /{
                         proxy_pass http://minio_ui;
                }
    }


server {
        listen       8271;
location / {
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_set_header   Host              $http_host;
        proxy_set_header   X-Real-IP         $remote_addr;

        proxy_connect_timeout 300;
        proxy_http_version 1.1;
        chunked_transfer_encoding off;
        proxy_ignore_client_abort on;

        proxy_pass http://minio_api;
    }
    }
 
  upstream minio_api{
   server  127.0.0.135:9000;
   server  127.0.0.136:9000;
   server  127.0.0.137:9000;
   server  127.0.0.138:9000;
}

upstream minio_ui{
   server  127.0.0.135:9090;
   server  127.0.0.136:9090;
   server  127.0.0.137:9090;
   server  127.0.0.138:9090;
}

然后java配置为nginx代理的端口就可以了

mc配置

安装golang

go下载mc

go install github.com/minio/mc@latest

短连接mc命令

ln -s /root/go/bin/mc /usr/bin/

补充minio配置连接

mc config host add minio-local http://127.0.0.1:9000 minioadmin minioadmin

查看连接

mc ls minio-local

minio systemctl配置

vi /etc/systemd/system/minio.service

[Unit]
Description=MinIO
Documentation=https://min.io/docs/minio/linux/index.html
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local

User=holmes
ProtectProc=invisible

ExecStart=/usr/local/bin/minio server /data/minio --console-address :8089

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536

# 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})

systemctl enable minio

k8s安装

DirectPV安装
首先要安装git,因为krew需要

修改git的配置,否则下载超时

git config --global http.postBuffer 524288000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

修改etc/hosts的地址
在https://www.ipaddress.com/中查询github.com和github.global.ssl.fastly.net对应的IP地址,并添加到hosts文件中
目前是

199.232.69.194 github.global-ssl.fastly.net
140.82.113.3 github.com

你可能感兴趣的:(java,linux,运维,服务器)