码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-01-09 16:52:00      阅读:529      评论:0      收藏:0      [点我收藏+]

标签:ati   mod   mic   location   ali   ceph   nts   forward   pass   

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个对象网关

标签:ati   mod   mic   location   ali   ceph   nts   forward   pass   

原文地址:https://www.cnblogs.com/kuku0223/p/8251459.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!