Difference between revisions of "Scality: Setup the RS2 (REST) Connector"
Jump to navigation
Jump to search
| Line 190: | Line 190: | ||
| List all object in all buckets || s3cmd la | | List all object in all buckets || s3cmd la | ||
|- | |- | ||
| − | | Put file into bucket || s3cmd put FILE [FILE…] s3://BUCKET[/PREFIX] | | + | | Put file into bucket || s3cmd put FILE [FILE…] s3://BUCKET[/PREFIX] |
| − | Get file from bucket s3cmd get s3://BUCKET/OBJECT LOCAL_FILE | + | |- |
| − | Delete file from bucket s3cmd del s3://BUCKET/OBJECT | + | | Get file from bucket || s3cmd get s3://BUCKET/OBJECT LOCAL_FILE |
| − | Synchronize a directory tree to S3 s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR | + | |- |
| − | Disk usage by buckets s3cmd du [s3://BUCKET[/PREFIX]] | + | | Delete file from bucket || s3cmd del s3://BUCKET/OBJECT |
| − | Get various information about buckets or files s3cmd info s3://BUCKET[/OBJECT] | + | |- |
| − | Copy object s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] | + | | Synchronize a directory tree to S3 || s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR |
| − | Move object s3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] | + | |- |
| − | Modify access control list for bucket or files s3cmd setacl s3://BUCKET[/OBJECT] | + | | Disk usage by buckets || s3cmd du [s3://BUCKET[/PREFIX]] |
| − | Sign arbitrary string using the secret key s3cmd sign STRING-TO-SIGN | + | |- |
| − | Fix invalid file names in a bucket s3cmd fixbucket s3://BUCKET[/PREFIX] | + | | Get various information about buckets or files || s3cmd info s3://BUCKET[/OBJECT] |
| − | List CloudFront distribution points s3cmd cflist | + | |- |
| − | Display CloudFront distribution point parameters s3cmd cfinfo [cf://DIST_ID] | + | | Copy object || s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] |
| − | Create CloudFront distribution point s3cmd cfcreate s3://BUCKET | + | |- |
| − | Delete CloudFront distribution point s3cmd cfdelete cf://DIST_ID | + | | Move object || s3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] |
| − | Change CloudFront distribution point parameters s3cmd cfmodify cf://DIST_ID | + | |- |
| + | | Modify access control list for bucket or files || s3cmd setacl s3://BUCKET[/OBJECT] | ||
| + | |- | ||
| + | | Sign arbitrary string using the secret key || s3cmd sign STRING-TO-SIGN | ||
| + | |- | ||
| + | | Fix invalid file names in a bucket || s3cmd fixbucket s3://BUCKET[/PREFIX] | ||
| + | |- | ||
| + | | List CloudFront distribution points || s3cmd cflist | ||
| + | |- | ||
| + | | Display CloudFront distribution point parameters || s3cmd cfinfo [cf://DIST_ID] | ||
| + | |- | ||
| + | | Create CloudFront distribution point || s3cmd cfcreate s3://BUCKET | ||
| + | |- | ||
| + | | Delete CloudFront distribution point || s3cmd cfdelete cf://DIST_ID | ||
| + | |- | ||
| + | | Change CloudFront distribution point parameters || s3cmd cfmodify cf://DIST_ID | ||
|} | |} | ||
Latest revision as of 09:46, 16 August 2013
- Assuming RING is setup and function, otherwise get back to the previous steps! http://wiki.bostonlabs.co.uk/w/index.php/Filesystems:_Scality
Install the RS2 Connector
yum install scality-rest-connectorConfigure the RS2 Connector
[root@blade2 scality]$ scality-rest-connector-config
Do you want to configure sagentd? If you answer no, default values will be used [y]:
Please, enter the prefix used to name nodes in the supervisor [blade2-c]:
Please, enter the IP address of this server for the supervisor [172.28.15.2]:
Please, enter the IP address of the supervisor [172.28.15.1]:
install new config
configuring usage of ssl
generating /etc/scality-rest-connector/connectors.conf
Starting connector: [ OK ]Add the Connector in the Web Interface
- Point browser to http://blade1:3080/
- Default Password is root/admin
- Connector should appear greyed out on the left hand side, click on it, then add connector.
Install brs2prov
Dependencies
yum install curl perl-Digest-HMAC
The brs2prov pacakge can be downloaded here: http://docs.scality.com/download/attachments/328517/brs2prov.zip?version=1&modificationDate=1348510607000
[root@blade2 ~]# unzip brs2prov.zip
Archive: brs2prov.zip
inflating: brs2prov
[root@blade2 ~]# cp brs2prov /usr/local/bin/Create a User
[root@blade2 ~]# ./brs2prov -adduser test -dname test -id admin -key provkey -host blade2:8180
<?xml version="1.0" encoding="UTF-8"?>
<AddUser><User>test</User>
<AccessKeyId>6B8F0973D32146CD6B8F09000000004000000120</AccessKeyId>
</AddUser>Install s3cmd
Before we set this up, we need add dnsmasq so *.blade2 get resolved correctly
Install dnsmask
yum install dnsmasq
Add folllowing line in /etc/dnsmasq.conf
address=/.<FQDN>/<IP> Example: address=/.blade2/172.28.15.2 /etc/init.d/dnsmasq restart
Update your resolv.conf to do DNS lookup locally first
[root@blade2 ~]# cat /etc/resolv.conf ; generated by /sbin/dhclient-script search local pxe.boston.co.uk. nameserver 172.28.15.2 nameserver 172.28.0.2
Test you can ping any subdomain:
ping any.blade2
Install s3cmd
yum install s3cmd- Note: When using Scality RS2 specify the username created using brs2prov and the authentication secret key stored in the supervisor (default is secretkey).
Lets run the --configure command which will create a default ~/.s3cfg file
root@blade2 ~]# s3cmd --configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3
Access Key: 6B8F0973D32146CD6B8F09000000004000000120
Secret Key: secretkey
Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/usr/bin/gpg]:
When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can't be used if you're behind a proxy
Use HTTPS protocol [No]:
On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't conect to S3 directly
HTTP Proxy server name:
New settings:
Access Key: 6B8F0973D32146CD6B8F09000000004000000120
Secret Key: secretkey
Encryption password:
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0
Test access with supplied credentials? [Y/n] n
Save settings? [y/N] y
Configuration saved to '/root/.s3cfg'Edit the .s3cfg file and update the amazon s3 references
# from:
host_base = s3.amazonaws.com
host_bucket = %(bucket)s.s3.amazonaws.com
# to:
host_base = blade2
host_bucket = %(bucket)s.blade2Final version of the .s3cfg file
[default]
access_key = test
bucket_location = US
cloudfront_host = cloudfront.amazonaws.com
cloudfront_resource = /2010-07-15/distribution
default_mime_type = binary/octet-stream
delete_removed = False
dry_run = False
encoding = UTF-8
encrypt = False
follow_symlinks = False
force = False
get_continue = False
gpg_command = /usr/bin/gpg
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_passphrase =
guess_mime_type = True
host_base = blade2
host_bucket = %(bucket)s.blade2
human_readable_sizes = False
list_md5 = False
log_target_prefix =
preserve_attrs = True
progress_meter = True
proxy_host =
proxy_port = 0
recursive = False
recv_chunk = 4096
reduced_redundancy = False
secret_key = secretkey
send_chunk = 4096
simpledb_host = sdb.amazonaws.com
skip_existing = False
socket_timeout = 300
urlencoding_mode = normal
use_https = False
verbosity = WARNINGNOTE: Encountered a problem here as the RS2 connector was pointing to localhost instead instead of 'blade2'
- You can correct this via the web interface
- Or by checking the output from ringsh -r demo accessor configGet | grep localhost
Some s3 Commands
| Action | s3cmd command with parameters |
| Make bucket | s3cmd mb s3://BUCKET |
| Remove bucket | s3cmd rb s3://BUCKET |
| List objects or buckets | s3cmd ls [s3://BUCKET[/PREFIX]] |
| List all object in all buckets | s3cmd la |
| Put file into bucket | s3cmd put FILE [FILE…] s3://BUCKET[/PREFIX] |
| Get file from bucket | s3cmd get s3://BUCKET/OBJECT LOCAL_FILE |
| Delete file from bucket | s3cmd del s3://BUCKET/OBJECT |
| Synchronize a directory tree to S3 | s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR |
| Disk usage by buckets | s3cmd du [s3://BUCKET[/PREFIX]] |
| Get various information about buckets or files | s3cmd info s3://BUCKET[/OBJECT] |
| Copy object | s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] |
| Move object | s3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2] |
| Modify access control list for bucket or files | s3cmd setacl s3://BUCKET[/OBJECT] |
| Sign arbitrary string using the secret key | s3cmd sign STRING-TO-SIGN |
| Fix invalid file names in a bucket | s3cmd fixbucket s3://BUCKET[/PREFIX] |
| List CloudFront distribution points | s3cmd cflist |
| Display CloudFront distribution point parameters | s3cmd cfinfo [cf://DIST_ID] |
| Create CloudFront distribution point | s3cmd cfcreate s3://BUCKET |
| Delete CloudFront distribution point | s3cmd cfdelete cf://DIST_ID |
| Change CloudFront distribution point parameters | s3cmd cfmodify cf://DIST_ID |