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. andeoid硬件解码

    Finally, I must say, finally, we get low-level media APIs in Android, the Android hardware decoding ...

  2. String代码示例

    package lianxi; public class lianxi0112 { public static void main(String[] args) { // TODO 自动生成的方法存根 ...

  3. ms人物上线

    在看MS人物上线 else if(gs2ms_add_player == pkt.cmd) { PlayerChannel* pPC = new PlayerChannel(this); //加到地图 ...

  4. 网页直播、微信直播技术解决方案:EasyNVR与EasyDSS流媒体服务器组合之区分不同场景下的easynvr

    近期遇到好多客户咨询关于实现微信直播.或者是将直播页面集成进入自己项目中. 该方案的主要目的:完成在公网一直进行内网摄像头的RTMP/HLS直播! 实现方案的具体实现: EasyNVR+EasyDSS ...

  5. 原型模式 private static Map<String,Prototype> map = new HashMap<String,Prototype>();

    public class PrototypeManager { /** * 用来记录原型的编号和原型实例的对应关系 */ private static Map<String,Prototype& ...

  6. php调用短网址接口

    <?php $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,"http://dwz.cn/create.php"); curl_se ...

  7. 取得微信用户OpenID

    公司需要微信这个平台和用户交流,于是开始研究微信公众平台.微信公众平台分为两种模式,其一是编辑模式,比如用户发什么内容,你可以响应什么内容.另外一种便是开发模式,这个模式功能丰富,不仅仅可以获取到用户 ...

  8. linux下编译安装python

    从官网下载指定的源码包 https://www.python.org/downloads/source/ 把源码文件以二进制方式上传到linux服务器 安装python需要用到gcc工具,首先查看gc ...

  9. 友盟分享到微信的几点备忘(IOS)

    1.下载最新的友盟分享版本,参考友盟官方的demo 2.注册微信开放平台用户,不是公众平台,注册应用 3.参考文档和demo,加入sdk包和相应的lib 4.在plist加入URL types.URL ...

  10. 关于android R.java文件无法创建的问题

    R.java文件无法创建的原因网上有很多说法普遍是以下两种: 1. xml文件有错误: 解决方法就是找到哪个xml有错然后把错误修复就OK了. 2.编码问题 这时候只要把xml文件的编码改成utf8就 ...