1、概述
安装3个网关节点分别是:controller-03、controller-04和controller-05,使用ceph gw自带的Civetweb提供服务,前端使用nginx作为前端代理。
2、分别在三各节点安装ceph gw
在ceph-deploy节点执行安装
ceph-deploy install --rgw controller-03 controller-04 controller-05
ceph-deploy --overwrite rgw create controller-03 controller-04 controller-05
执行上面的命令不成功
 
分别在每个gw节点上执行:yum install ceph-radosgw,然后再执行:ceph-deploy --overwrite rgw create controller-03 controller-04 controller-05成功。
可以看到网关已经运行。
ceph gw 默认使用自带Civetweb提供服务,在浏览器输入host:7480,可以看到正确运行
  
3、配置各节点网关
在controller-03执行:ceph auth get client.rgw.controller-03 > /etc/ceph/ceph.client.radosgw.keyring
在controller-04执行:ceph auth get client.rgw.controller-04 > /etc/ceph/ceph.client.radosgw.keyring
在controller-05执行:ceph auth get client.rgw.controller-05 > /etc/ceph/ceph.client.radosgw.keyring
 
配置ceph.conf文件:
[client.rgw.controller-03]

rgw_frontends = "civetweb port=8899"
host = controller-03
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw dns name = xiangcloudos.com
rgw socket path = /var/run/ceph/ceph-client.rgw.controller-03.asok
rgw content length compat = true
[client.rgw.controller-04]
rgw_frontends = "civetweb port=8899"
host = controller-04
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw dns name = xiangcloudos.com
rgw socket path = /var/run/ceph/ceph-client.rgw.controller-04.asok
rgw content length compat = true
[client.rgw.controller-05]
rgw_frontends = "civetweb port=8899"
host = controller-05
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw dns name = xiangcloudos.com
rgw socket path = /var/run/ceph/ceph-client.rgw.controller-05.asok
rgw content length compat = true
 
分发配置然后重新启动每个节点的cephgw,执行 service radosgw restart.
4、nginx配置
当前在controller-01上安装nginx,配置nginx作为cephgw的前端代理。
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
 
include /etc/nginx/conf.d/*.conf;
upstream ceph_radosgw_zone {
  server controller-03:8899 weight=1 max_fails=2 fail_timeout=5;
  server controller-04:8899 weight=1 max_fails=2 fail_timeout=5;
  server controller-05:8899 weight=1 max_fails=2 fail_timeout=5;
}
server {
listen 81 default_server;
listen [::]:81 default_server;
server_name xiangcloudos.com;
 
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
if ($host ~* (.*)\.xiangcloudos\.com$)
{
set $sub_dom '$1';
rewrite ^(.*)$ /$sub_dom$1 last;
}
location /
{
proxy_pass http://ceph_radosgw_zone;
}
}
}
5、创建cephgw存储池
ceph osd pool create .rgw 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.root 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.control 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.gc 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.buckets 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.buckets.index 128 128 replicated_sata_ruleset
ceph osd pool create .rgw.buckets.extra 128 128 replicated_sata_ruleset
ceph osd pool create .log 128 128 replicated_sata_ruleset
ceph osd pool create .intent-log 128 128 replicated_sata_ruleset
ceph osd pool create .usage 128 128 replicated_sata_ruleset
ceph osd pool create .users 128 128 replicated_sata_ruleset
ceph osd pool create .users.email 128 128 replicated_sata_ruleset
ceph osd pool create .users.swift 128 128 replicated_sata_ruleset
ceph osd pool create .users.uid 128 128 replicated_sata_ruleset
6、创建radosgw用户进行访问
radosgw-admin user create --uid="admin" --display-name="admin"
{
  "user_id": "admin",
  "display_name": "admin",
  "email": "",
  "suspended": 0,
  "max_buckets": 1000,
  "auid": 0,
  "subusers": [],
  "keys": [
  {
    "user": "admin",
    "access_key": "8NCG9CGJ1XHAUUXSJ5IS",
    "secret_key": "bC4POA9I8tmC1FgP1DCFx5YpB7m6kExzFkoaO0Hm"
  }
  ],
  "swift_keys": [],
  "caps": [],
  "op_mask": "read, write, delete",
  "default_placement": "",
  "placement_tags": [],
  "bucket_quota": {
    "enabled": false,
    "max_size_kb": -1,
    "max_objects": -1
},
"user_quota": {
  "enabled": false,
  "max_size_kb": -1,
  "max_objects": -1
},
"temp_url_keys": []
}
创建swift用户:
radosgw-admin subuser create --uid=admin --subuser=admin --access=full
{
  "user_id": "admin",
  "display_name": "admin",
  "email": "",
  "suspended": 0,
  "max_buckets": 1000,
  "auid": 0,
"subusers": [
{
  "id": "admin:admin",
  "permissions": "full-control"
}
],
"keys": [
{
  "user": "admin",
  "access_key": "8NCG9CGJ1XHAUUXSJ5IS",
  "secret_key": "bC4POA9I8tmC1FgP1DCFx5YpB7m6kExzFkoaO0Hm"
},
{
  "user": "admin:admin",
  "access_key": "FI05ZE4AEV3H8Y0BJP6D",
  "secret_key": ""
}
],
"swift_keys": [],
"caps": [],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
  "enabled": false,
  "max_size_kb": -1,
  "max_objects": -1
},
"user_quota": {
  "enabled": false,
  "max_size_kb": -1,
  "max_objects": -1
},
"temp_url_keys": []
}
radosgw-admin key create --subuser=admin:swift --key-type=swift --gen-secret
{
  "user_id": "admin",
  "display_name": "admin",
  "email": "",
  "suspended": 0,
  "max_buckets": 1000,
  "auid": 0,
  "subusers": [
  {
    "id": "admin:admin",
    "permissions": "full-control"
  }
  ],
  "keys": [
  {
  "user": "admin",
  "access_key": "8NCG9CGJ1XHAUUXSJ5IS",
  "secret_key": "bC4POA9I8tmC1FgP1DCFx5YpB7m6kExzFkoaO0Hm"
  },
  {
  "user": "admin:admin",
  "access_key": "FI05ZE4AEV3H8Y0BJP6D",
  "secret_key": ""
  }
  ],
  "swift_keys": [
  {
  "user": "admin:swift",
  "secret_key": "2BQyi6uMi1lKfq1fDcrYiA2ApcUimtYzXMuiRoC8"
  }
  ],
  "caps": [],
  "op_mask": "read, write, delete",
  "default_placement": "",
  "placement_tags": [],
  "bucket_quota": {
  "enabled": false,
  "max_size_kb": -1,
  "max_objects": -1
  },
  "user_quota": {
  "enabled": false,
  "max_size_kb": -1,
  "max_objects": -1
  },
"temp_url_keys": []
}
7、测试
import boto
import boto.s3.connection access_key = '8NCG9CGJ1XHAUUXSJ5IS'
secret_key = 'bC4POA9I8tmC1FgP1DCFx5YpB7m6kExzFkoaO0Hm'
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = 'controller-01', port = 81,
is_secure=False, calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)
bucket = conn.create_bucket('polly')
for bucket in conn.get_all_buckets():
print "{name}".format(name = bucket.name,)
print "{created}".format(created = bucket.creation_date,)
for key in bucket.list():
print "{name}\t{size}\t{modified}".format(name = key.name,size = key.size,modified = key.last_modified,)

ceph安装对象网关的更多相关文章

  1. ceph 008 ceph多区域网关(ceph对象容灾) cephfs文件系统

    clienta作为集群的管理人员.一部分.他是需要秘钥与配置文件的 但真正服务端只需要通过curl就好 ceph 多区域网关 对象存储容灾解决方案 zone与zone会做数据同步. 把会做同步的rgw ...

  2. Ceph之对象存储网关RADOS Gateway(RGW)

    一.Ceph整体架构及RGW在Ceph中的位置 1.Ceph的整体架构 Ceph是一个统一的.分布式的的存储系统,具有优秀的性能.可靠性和可扩展性.Ceph支持对象存储(RADOSGW).块存储(RB ...

  3. CEPH-4:ceph RadowGW对象存储功能详解

    ceph RadosGW对象存储使用详解 一个完整的ceph集群,可以提供块存储.文件系统和对象存储. 本节主要介绍对象存储RadosGw功能如何灵活的使用,集群背景: $ ceph -s clust ...

  4. 010 Ceph RGW对象存储

    一.对象存储 1.1 介绍 通过对象存储,将数据存储为对象,每个对象除了包含数据,还包含数据自身的元数据 对象通过Object ID来检索,无法通过普通文件系统操作来直接访问对象,只能通过API来访问 ...

  5. ceph 安装记录

    ceph 安装 http://docs.ceph.com/docs/master/start/quick-ceph-deploy/ 1. 系统要求 centos 7 systemctl disable ...

  6. CEPH安装教程(上)

    环境拓扑 主机 配置 地址 运行服务 node CPU:1 内存:2GB 磁盘:vda(20GB) br-mgmt:92.0.0.250 br-ex:192.168.203.250/19 ntp an ...

  7. ceph 007 双向池同步 rgw对象网关配置 s3对象存储

    增量导入导出要基于快照 导出的过程当中害怕镜像被修改所以打快照.快照的数据是不会变化的 镜像级别的双向同步 镜像主到备,备到主.一对一 就算是池模式的双向同步,镜像也具有主备关系 双向同步,池模式 [ ...

  8. ceph 搭建nginx负载3个对象网关

    nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid ...

  9. ceph 安装ceph问题汇总

    1.在不同节点安装ceph时,出现以下异常: 参考这里 ceph deploy RuntimeError: NoSectionError: No section: 'ceph' 解决方法: 在报错的机 ...

随机推荐

  1. JAVA程序开发按位运算的记录

    忘记在哪里看到一个面试题:把int a,b的值互换,不能使用临时变量.刚开始完全懵逼,脑子里面全是浆糊,不知道如何下手.查看答案后猛地一惊,心想居然还有这种操作,真是叹为观止,真的感觉自己的基础是如此 ...

  2. 【TensorFlow-windows】(六) CNN之Alex-net的测试

    主要内容: 1.CNN之Alex-net的测试 2.该实现中的函数总结 平台: 1.windows 10 64位 2.Anaconda3-4.2.0-Windows-x86_64.exe (当时TF还 ...

  3. 关于msbuild 编译.net 4.5新语法错误的解决方法

    .net4.5以前msbuild 是在%windir%/Microsoft.NET/FrameworkXX/vXX目录下,如:C:\Windows\Microsoft.NET\Framework64\ ...

  4. python爬虫入门篇

    优质爬虫入门源码:https://github.com/lining0806/PythonSpiderNotes Python Spider:https://www.cnblogs.com/wangy ...

  5. 自我总结- CGAffineTransform

    在应用中我们经常需要做一些仿射变换 可以用于 平移.旋转.缩放变换路径: View有一个属性transform 可以指定一个 CGAffineTransform 即可完成仿射变换 1.平移变换 // ...

  6. 使用Reveal来查看别人的APP界面+白苹果不刷机解决方式

    Reveal这个强大的界面调试工具.能够实时查看.改动view的属性,大体上实现了iOS程序猿梦寐以求的功能.比方,有时候我们加入了一个view,可是那个view死活不显示出来,这时候祭出Reveal ...

  7. tps 与 事务平均响应时间关系对答(转)

    问者:每秒处理的事务数和事务的平均响应时间 怎么个关系,有关系吗 kaku21:举个例子:一个高速路 有10个入口,每个入口每秒钟只能进1辆车,请问1秒钟最多能进几辆车?? 问者:10 kaku21: ...

  8. java中Random(long seed)方法与rRandom()方法的使用产生随机数

    Random 类作为JAVA中用于产生的随机数 ,new  Random(10)  :10是种子数. 注意:Random 的一个特点是:相同种子数的Random对象,对应相同次数生成的随机数字是完全相 ...

  9. 九度OJ 1149:子串计算 (计数、排序)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1026 解决:571 题目描述: 给出一个01字符串(长度不超过100),求其每一个子串出现的次数. 输入: 输入包含多行,每行一个字符串. ...

  10. 九度OJ 1036:Old Bill (老比尔) (基础题)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2691 解决:1432 题目描述: Among grandfather's papers a bill was found.     72 ...