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

Posted kuku0223

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ceph 搭建nginx负载3个对象网关相关的知识,希望对你有一定的参考价值。

nginx.conf 

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

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

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;
        server {
                listen 80 default_server;
                listen [::]:80 default_server;
                server_name cephcloud.com;

                # Load configuration files for the default server block.
                include /etc/nginx/default.d/*.conf;
                if ($host ~* (.*)\\.cephcloud\\.com$){
                        set $sub_dom ‘$1‘;
                        rewrite ^(.*)$ /$sub_dom$1 last;
                        }
                location /{
                        proxy_pass http://ceph_radosgw_zone;
                        }
        }
}

upstream.conf

upstream ceph_radosgw_zone {
    server mon-node1:7480  weight=1 max_fails=2 fail_timeout=5;
    server mon-node2:7480  weight=1 max_fails=2 fail_timeout=5;
    server mon-node3:7480  weight=1 max_fails=2 fail_timeout=5;
}

/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.101.0.102 admin-node  cephcloud.com
10.101.0.95 mon-node1
10.101.0.96 mon-node2
10.101.0.97 mon-node3
10.101.0.98 data-node1
10.101.0.99 data-node2
10.101.0.100 data-node3
127.0.0.1 cephcloud.com

 

技术分享图片

 

以上是关于ceph 搭建nginx负载3个对象网关的主要内容,如果未能解决你的问题,请参考以下文章

Ceph使用系列之——Ceph RGW使用

《springcloud 二》SrpingCloud Zuul 微服务网关搭建

Nginx总结

nginx环境搭建---1

Ceph对象存储反向代理

谷粒商城Nginx转网关(二十一)