运维八一 运维八一
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)

运维八一

运维,运维!
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)
  • 操作系统

  • 域名解析

  • 公有云

  • CI&CD

  • 数据库

  • 负载均衡&反向代理

  • 存储系统

    • ceph
    • ceph常见问题
    • longhorn部署
    • local-path部署
    • ceph、longhorn、local-path存储压力测试对比
    • raid介绍
    • 创建raid
    • ISCSI 企业存储方案
    • seaweedfs部署
      • 安装部署
      • 测试
        • S3常用命令
  • 容器&容器编排

  • 批量管理

  • 邮件系统

  • 监控系统

  • Web服务

  • 虚拟化

  • 防火墙

  • 压测

  • 文件同步

  • 私有云

  • 日志系统

  • 代码仓库&版本管理

  • 安全审计

  • 远程拨号

  • 大数据

  • 统一认证

  • 消息队列

  • Apollo

  • 运维杂记
  • 存储系统
lyndon
2023-02-13
目录

seaweedfs部署

# 安装部署

下载seaweedfs

wget https://github.com/chrislusf/seaweedfs/releases/download/2.29/linux_amd64.tar.gz
tar xf linux_amd64.tar.gz
mv weed /usr/bin/
1
2
3

创建目录

mkdir /etc/sea
mkdir /etc/sea/data
mkdir -p /etc/sea/vol/vol{1..3}
mkdir /etc/sea/logs
mkdir /etc/sea/filer
mkdir /etc/sea/s3
1
2
3
4
5
6

启动master

nohup weed master -mdir=/etc/sea/data -port=9333 -defaultReplication="001" -ip="172.30.65.24" &>> /etc/sea/logs/master.log &
1

启动volume

nohup weed volume -dir=/etc/sea/vol/vol1 -mserver="172.30.65.24:9333" -port=8081 -ip="172.30.65.24" &>>/etc/sea/logs/vol1.log &

nohup weed volume -dir=/etc/sea/vol/vol2 -mserver="172.30.65.24:9333" -port=8082 -ip="172.30.65.24" &>>/etc/sea/logs/vol2.log &

nohup weed volume -dir=/etc/sea/vol/vol3 -mserver="172.30.65.24:9333" -port=8083 -ip="172.30.65.24" &>>/etc/sea/logs/vol3.log &
1
2
3
4
5

启动filer(使用leveldb2):

  • 查看filer默认配置
weed scaffold filer -output=""
1
  • 创建filer配置文件
cat >> /etc/sea/filer.toml << EOF
[leveldb2]

# local on disk, mostly for simple single-machine setup, fairly scalable

# faster than previous leveldb, recommended.

enabled = true
dir = "/etc/sea/filer/level"					# directory to store level db files
EOF
1
2
3
4
5
6
7
8
9
10
  • 启动
nohup weed filer ip=172.30.65.24 -port=8888 -port.readonly=7777 -master=172.30.65.24:9333 > /etc/sea/logs/filer.log &
1

启动s3

weed s3 -config /etc/sea/s3/config.json -filer "172.30.65.24:8888" -port 8889 > /etc/sea/logs/s3.log &
1

# 测试

mount测试

weed mount -filer=172.30.65.24:8888 -dir=/tmp/filer &
1

s3测试

# S3常用命令

1、配置,主要是 Access Key ID 和 Secret Access Key

s3cmd --configure
1

2、列举所有 Buckets。(bucket 相当于根文件夹)

s3cmd ls
1

3、创建 bucket,且 bucket 名称是唯一的,不能重复,默认创建的 bucket 是公开的。

s3cmd mb s3://my-bucket-name
1

4、删除空 bucket

s3cmd rb s3://my-bucket-name
1

5、列举 Bucket 中的内容

s3cmd ls s3://my-bucket-name
1

6、上传

s3cmd put file.txt s3://my-bucket-name/file.txt
1

-- 支持批量上传,直接指定多个文件,如

s3cmd put t.py s3://tccpoc/t.py up.py s3://tccpoc/up.py
1

-- 如果上传终断,比如ctrl+c,会显示upload-id,按照指示,带上--upload-id就可以实现断点上传

7、上传并将权限设置为所有人可读

s3cmd put --acl-public file.txt s3://my-bucket-name/file.txt
1

--acl-private,也可以是私有

8、批量上传文件

s3cmd put ./* s3://my-bucket-name/
1

9、下载文件

s3cmd get s3://my-bucket-name/file.txt file.txt
1

支持批量下载,直接指定多个文件,如

s3cmd get s3://tccpoc/t.py s3://tccpoc/up.py
1

如果下载终断,比如ctrl+c,带上参数--continue,可以实现断点下载

10、批量下载

s3cmd get s3://my-bucket-name/* ./
1

11、删除文件,

s3cmd del s3://my-bucket-name/file.txt
1

支持批量删除,直接指定多个 bucket 对象,如

s3cmd del s3://my-bucket-name/file.txt s3://my-bucket-name/file2.txt
1

12、来获得对应的bucket所占用的空间大小

s3cmd du -H s3://my-bucket-name
1

13、设置桶策略

s3cmd setpolicy examplepol s3://First-bucket  # 设置桶策略
s3cmd delpolicy s3://First-bucket # 删除桶策略
s3cmd info s3://First-bucket # 查看桶策略

cat examplepol
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": [
      "arn:aws:s3:::happybucket/*"
    ]
  }]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
上次更新: 2023/02/13, 13:52:57
ISCSI 企业存储方案
kubeadm安装k8s单点(centos系统)

← ISCSI 企业存储方案 kubeadm安装k8s单点(centos系统)→

最近更新
01
ctr和crictl显示镜像不一致
03-13
02
alpine镜像集成常用数据库客户端
03-13
03
create-cluster
02-26
更多文章>
Theme by Vdoing | Copyright © 2015-2024 op81.com
苏ICP备18041258号-2
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式