#!/usr/bin/ruby
require 'fileutils'
mybasedir = '/var/lib/cass'
mydatadir = mybasedir + '/data'
mysnapshotlinksdir = mybasedir + '/snapshots'
FileUtils.remove_dir(mysnapshotlinksdir) if File.exists?(mysnapshotlinksdir)
Dir.chdir mydatadir
mysnapshotdirs = Dir.glob("**/*/")
mysnapshotdirs = mysnapshotdirs.grep(/snapshots\/.+/)
#p mysnapshotdirs
mysnapshots = {}
mysnapshotdirs.each do |mydir|
mysnapshot = {}
myparts = mydir.split('/')
mysnapshot['keyspace'] = myparts[0]
mysnapshot['cf'] = myparts[1]
mysnapshot['tag'] = myparts[3]
mysnapshot['linkdir'] = [mysnapshotlinksdir, mysnapshot['tag'], mysnapshot['keyspace']].join('/')
mysnapshot['link'] = [mysnapshotlinksdir, mysnapshot['tag'], mysnapshot['keyspace'], mysnapshot['cf']].join('/')
mysnapshot['target'] = [mydatadir, mydir].join('/')
#p mysnapshot
FileUtils.mkpath mysnapshot['linkdir'] unless File.exists?(mysnapshot['linkdir'])
File.symlink(mysnapshot['target'], mysnapshot['link']) unless File.symlink?(mysnapshot['link'])
end
Showing posts with label single. Show all posts
Showing posts with label single. Show all posts
Tuesday, 27 January 2015
Cassandra: links to snapshots in one place
Use rsync with '-L' to copy elsewhere.
Tuesday, 1 October 2013
Create isolated bucket on S3
- setup
- create IAM group
- add simple, custom policy below
- do not add any other policies to group
- create IAM user and put in above IAM group
- create and download key and secret for user
- create bucket "mybucket01" in S3
- you don't have to touch perms of bucket itself
- client
- install s3fox addon for Firefox from www.s3fox.net
- older versions FAIL! get it only at www.s3fox.net
- open s3fox addon
- Firefox -> Tools -> S3 Organizer
- add only one user to "Manage Accounts" using user key and secret
- in right-hand window of s3fox add "/mybucket01" NOT "/"
- "/" will give you "Access Denied"
- because user does not have perms to list root buckets, only itself
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::mybucket01"
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::mybucket01",
"arn:aws:s3:::mybucket01/*"
]
}
]
}
Labels:
bucket,
exclusive,
individual,
isolated,
s3,
single,
single user,
user
Subscribe to:
Posts (Atom)
Interview questions: 2020-12
Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer Networking Layer 1 vs Layer 4 haproxy u...
-
CRITICAL: AWS now offers internal VPC DNS! Below is no longer necessary AFAIK. Woo hoo! http://aws.amazon.com/about-aws/whats-new/2014/...
-
build sudo apt-get install git gcc sudo apt-get install automake autoconf git clone git://github.com/rriley/tsunami-udp.git cd tsunam...
-
From: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382972#c4 Assumptions: jEdit was installed into /Applications directory. Close any...