Ceph RagosGW 설치 및 구성

8133 단어
RagosGW 설치 및 구성
당분간 이거 안 해도 돼요.
만약 이것을 설정한다면 주요 목적은 RADOSGW 대상 저장 스위치를 익히는 것이다
 
작업 전에 스냅샷을 백업하고, 비교적 번거로워 보이기 때문에
lxpnode1에radosgw 만들기
 
4.1 설치 구성 Apache
Apt-get 소스:
1. 아파치2 설치 다운로드
# apt-get install apache2
# apt-get install libapache2-mod-fastcgi
 
2./etc/apache2/apache2 구성 2.conf
추가:
ServerName lxpnode1
3. rewrite와fastcgi 모듈 불러오기
# a2enmod rewrite
# a2enmod fastcgi
 
4. 아파치 서비스 시작
# service apache2 start
4.2 SSL 활성화
4.2.1 설치
# apt-get install openssl ssl-cert
 
4.2.2 SSL 모듈 로드
# a2enmod ssl
4.2.3 인증서 생성
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout/etc/apache2/ssl/apache.key -out/etc/apache2/ssl/apache.crt
모두 회차
Generating a 2048 bit RSA private key
........................................................................................................................+++
...........................................+++
writing new private key to '/etc/apache2/ssl/apache.key'
-----
You are about to be asked to enter information that will beincorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Nameor a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
root@lxpnode1:/etc/apache2#
4.2.4 아파치 재시작
# service apache2 restart
 
4.3 Ceph Object Gateway 데몬 설치
해강의 원본을 사용하는데, ubuntutrusty의 원본은 모두 0.80이다.x, ubuntu vivivid의 원본 버전은 0.94.5입니다. 원본을 vivid로 변경합니다.
# apt-get install ceph
root@lxpnode1:/etc/apt# ceph -v
ceph version 0.94.5 (9764da52395923e0b32908d83a9f7304401fee43)
그런 다음 ceph-radosgw를 설치합니다.
 
 
root@lxpnode1:/etc/apt# ceph -s
    cluster19c11869-2430-4b9a-8152-e60e36064826
     health HEALTH_OK
     monmap e1: 1 mons at{lxpnode1=192.168.11.6:6789/0}
            election epoch 1,quorum 0 lxpnode1
     osdmap e20: 2 osds: 2 up,2 in
      pgmap v1414: 124 pgs, 2pools, 148 bytes data, 4 objects
            3642 MB used,33380 MB/39051 MB avail
                 124active+clean
아직도 HEALTHOK, 영향 없음
다음은 radosgw를 설치합니다.
# apt-get install radosgw
# apt-get install radosgw-agent
 
4.4 Ceph Object Gateway 구성
4.4.1 사용자 및 키링 만들기
(1) 게이트웨이 서버에 키링 만들기
# ceph-authtool --create-keyring/etc/ceph/ceph.client.radosgw.keyring
# chmod +r ceph.client.radosgw.keyring
 
(2) 모든 게이트웨이 실례에 이름과 키를 생성한다.client에서.radosgw 뒤에 이 이름을 사용합니다(아래 실례의 이름은gateway).
# ceph-authtool/etc/ceph/ceph.client.radosgw.keyring -n client.radosgw.gateway --gen-key 
(3) 키 권한 추가
# ceph-authtool -n client.radosgw.gateway--cap osd 'allow rwx' --cap mon 'allow rwx'/etc/ceph/ceph.client.radosgw.keyring
(4) 키를 Ceph storage cluster에 추가:
# ceph -k/etc/ceph/ceph.client.admin.keyring auth add client.radosgw.gateway -i/etc/ceph/ceph.client.radosgw.keyring
(5) 키를 다른 게이트웨이 서버로 복사합니다. 여기는 한 대만 있고 복사할 필요가 없습니다.
#sudo scp/etc/ceph/ceph.client.radosgw.keyring  root@{hostname}:/etc/ceph/
 
주: 1-4단계는 Ceph의 관리자 노드에서 실행되며, 관리자 노드와 스위치 서버가 한 기계에 있으면 5단계는 실행할 필요가 없습니다.
 
4.4.2 풀 생성
#ceph osd pool create .rgw 32 32
#ceph osd pool create .rgw.root 32 32
#ceph osd pool create .rgw.control 32 32
#ceph osd pool create .rgw.gc 32 32
#ceph osd pool create .rgw.buckets 32 32
#ceph osd pool create .rgw.buckets.index 32 32
#ceph osd pool create .log 32 32
#ceph osd pool create .intent-log 32 32
#ceph osd pool create .usage 32 32
#ceph osd pool create .users 32 32
#ceph osd pool create .users.email 32 32
#ceph osd pool create .users.swift 32 32
#ceph osd pool create .users.uid 32 32
 
root@lxpnode1:/etc/ceph# rados lspools
rbd
rbd_pool
.rgw
.rgw.root
.rgw.control
.rgw.gc
.rgw.buckets
.rgw.buckets.index
.log
.intent-log
.usage
.users
.users.email
.users.swift
.users.uid
 
4.4.3 Ceph에 게이트웨이 구성 파일 추가
Apache 버전:
 
root@lxpnode1:/etc/ceph# apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Apache2.2와 초기 2.4 버전,admin 노드의/etc/ceph/ceph.conf에 추가:
[client.radosgw.gateway]
host = {hostname}
keyring =/etc/ceph/ceph.client.radosgw.keyring
rgw socket path = ""
log file =/var/log/radosgw/client.radosgw.gateway.log
rgw frontends = fastcgi socket_port=9000socket_host=0.0.0.0
rgw print continue = false
 
Apache 2.4.9 및 다음 버전:
[client.radosgw.gateway]
host = {hostname}
keyring =/etc/ceph/ceph.client.radosgw.keyring
rgw socket path =/var/run/ceph/ceph.radosgw.gateway.fastcgi.sock
log file =/var/log/radosgw/client.radosgw.gateway.log
rgw print continue = false
주:Apache 2.4.7 이전 방식으로radosgw 서비스는 일어나지 않고 다음 방식은OK,Apache2.4.7 Unix Domain Socket 지원
 
4.4.4 Ceph 구성 파일 배포
(1) 업데이트/etc/ceph/ceph.conf - Ceph 클러스터의 루트 디렉토리:
# ceph-deploy --overwrite-conf config pulllxpnode1
(2) 관리자 노드의ceph.conf를 다른 노드로 복사
# ceph-deploy  --overwrite-conf config push lxpnode2lxpnode3
 
4.4.5 복제ceph.client.admin.keyring - 게이트웨이 서버
내가 있는 이곳의 인터넷 스위치 서버는 집단의 몬이기 때문에 복사할 필요가 없다
 
4.4.6 CGI wrapper 스크립트 만들기
1. 스크립트 생성:
#sudo vi/var/www/html/s3gw.fcgi
2. 관련 항목 추가:
#!/bin/sh
exec/usr/bin/radosgw -c/etc/ceph/ceph.conf -n client.radosgw.gateway
3. 스크립트 실행 권한 부여:
#sudo chmod +x/var/www/html/s3gw.fcgi
4.4.7 CGI wrapper 스크립트 사용 권한 조정
#sudo chown www-data:www-data/var/www/html/s3gw.fcgi
Note: Ubuntu 기본 아파치 사용자는 ww-data: www-data
 
4.4.8 데이터 저장 디렉터리 만들기
#mkdir -p/var/lib/ceph/radosgw/ceph-radosgw.gateway
 
4.4.9 socket 디렉터리 권한 조정
# chown www-data:www-data/var/run/ceph
 
4.4.10 로그 파일 수정 권한
root@lxpnode1:/etc/ceph# touch /var/log/radosgw/client.radosgw.gateway.log
root@lxpnode1:/etc/ceph# chownwww-data:www-data/var/log/radosgw/client.radosgw.gateway.log
 
4.4.11radosgw 서비스 시작
#/etc/init.d/radosgw start
 
4.4.12 게이트웨이 구성 파일 생성
1.Create thefile:
#sudovi/etc/apache2/sites-available/rgw.conf
2.add thefollowing contents to the file:
FastCgiExternalServer /var/www/html/s3gw.fcgi -socket /var/run/ceph/ceph.radosgw.gateway.fastcgi.sock

<VirtualHost *:8080>

 ServerName {hostname}
 ServerAlias *.{hostname}
 ServerAdmin [email protected]
 DocumentRoot /var/www/html
 RewriteEngine On
 RewriteRule ^/(.*) /s3gw.fcgi?%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

 <IfModule mod_fastcgi.c>
 <Directory /var/www/html>
 Options +ExecCGI
 AllowOverride All
 SetHandler fastcgi-script
 Order allow,deny
 Allow from all
 AuthBasicAuthoritative Off
 </Directory>
 </IfModule>

 AllowEncodedSlashes On
 ErrorLog /var/log/apache2/error.log
 CustomLog /var/log/apache2/access.log combined
 ServerSignature Off
</VirtualHost>

배치된 노드에 아파치2 서비스가 80 포트를 사용하고 있다면 아파치 다중 포트, rgw를 설정해야 합니다.conf에서 다음과 같이 변경되었습니다.
Listen 8080
3. rgw.conf 구성에 For Debian/Ubuntu distributions, enable the site forrgw가 적용됩니다.conf. root@lxpnode1:/etc/apache2#a2ensite rgw.conf
Enabling site rgw.
To activate the new configuration, you need to run:
  serviceapache2 reload
root@lxpnode1:/etc/apache2# a2dissite000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
  serviceapache2 reload
 
4.4.13 아파치2 재시작
# service apache2 restart

좋은 웹페이지 즐겨찾기