EBS tutorial mount point and file permissions related

103 views
Skip to first unread message

RodneyQ

unread,
Aug 25, 2008, 10:28:44 AM8/25/08
to ec2ubuntu

Hi Guys,

I was able to follow the your tutorial about EBS, mysql server
installed(note mysql uid=105, gid=111) . A new snapshot was created
and a new volume is made using that snapshot.

On the new instance with several users created before mysql-server is
installed, the volume is attached. But one thing I notice, after
mounting the new volume it gets the different file permissions.

Perhaps we should be careful or change the ownership of the mysql data
to the correct owner after mounting the volume..just a thought.

Thanks,
Rodney


Eric Hammond

unread,
Aug 30, 2008, 4:09:32 AM8/30/08
to ec2ubuntu
Rodney:

Excellent point. Thanks for catching this.

I have updated the tutorial with a couple lines to fix mysql file
ownership in the event any other users were created before the mysql-
server package was installed.

http://ec2ebs-mysql.notlong.com

Thanks,
--
Eric Hammond
http://www.anvilon.com

Srikanth Pagadala

unread,
Aug 30, 2008, 4:17:09 AM8/30/08
to ec2u...@googlegroups.com
Eric
 
in one of your posts you said, the snapshot script http://ec2-snapshot-xfs-mysql.notlong.com is not robust yet.
i'm not a perl/unix script expert, so was wondering whats is lacking in it.
I'm in the process of "bundling" an image with this script to snapshot my ESB along with many other stuff ...
do you think this script is production ready?

Eric Hammond

unread,
Aug 30, 2008, 4:47:44 AM8/30/08
to ec2ubuntu
Srikanth:

I guess my main complaints (against myself) are that the script does
not validate user input and does not do a good job of checking for
errors from the statements it runs. It pretty much assumes the world
is perfect.

That said, I'm using the script personally until I get around to
improving it.

Patches welcomed.

--
Eric Hammond
http://www.anvilon.com

On Aug 30, 1:17 am, "Srikanth Pagadala" <srikanth.pagad...@gmail.com>
wrote:

Hareem Haque

unread,
Aug 30, 2008, 11:02:59 AM8/30/08
to ec2u...@googlegroups.com
Folks. A quick question. Which filesystem would you recommend i use. I
only need to persistently store data. I would be needing mysql to run
within EBS. Is XFS better or EXT3

Regards
Hareem.Haque

Srikanth Pagadala

unread,
Aug 30, 2008, 12:11:09 PM8/30/08
to ec2u...@googlegroups.com
:o) hmm..that should not be a problem in most of the cases in this context, as this script should be called by cron.
In cron env, once inputs (and paths etc) are properly set in ~ dirs, things will not go wrong.
 
New questions:
 
  • is there any way to detect the 'attached vol-id' in the EC2 instance? bascially what i want to do is somehow automate the input arguments to your "snapshot" script and bundle an image. so whenever an instance is launched from this image, the cron kick starts the "snapshot" script, which internally detects the attached (if any) volume and starts backing it up. If more than one volumes are attached to the EC2 instance, then it would backup all of them. Possible?
  • FEATURE REQUEST: can we build a very simple throw away policy (delete old snapshot strategy) in the script, such that whenever it creates a new snapshot, it also does some level of cleanup.
Unfortunately I cannot contribute patches for the script, as I'm more of a Flex/Java guy. These unix level scripts are too daunting for me. Without your AMIs and scripts, I dont know what would i have done.
 
thanks once again.

Srikanth Pagadala

unread,
Aug 30, 2008, 12:22:07 PM8/30/08
to ec2u...@googlegroups.com
Hareem
 
i took Eric's recommendation and stayed with XFS. so far, it is working very well for me. I've a giant mysql on my XFS mount, which gets snapshoted every hour. i believe XFS is more optimized for LOCKING kinda stuff, which is kinna more desired here. Again, I'm not a UNIX guy, so I've been taking expert (Eric's) advice all along.

Hareem Haque

unread,
Aug 30, 2008, 12:32:16 PM8/30/08
to ec2u...@googlegroups.com
I generally use mencoder for video conversion for a few clients. Thats
the main reason for me having an AWS account.

After the data processing gets done I upload the data to my S3 account.
The Mysql db only contains public links to this content. So the largest
db that i have created is a few megabytes.

The reason i asked was that i heard from a few people that XFS will
freeze on its on and its not a very reliable fs.

But on the forums i see a lot of people using xfs and even Rightscale
recommends it. I wanted to know if it would be better as a db fs cause
i dont know how to freeze the fs from rightscale. However, thanks for
the info. I will most certainly try out xfs. Hopefully, everything would
work out ok.

Lastly, Eric you have out done your self. I read your article and its
very well written and its by one of the easiest instructions article
that I have come across.

Regards
Hareem. Haque

Srikanth Pagadala wrote:
> Hareem
>
> i took Eric's recommendation and stayed with XFS. so far, it is
> working very well for me. I've a giant mysql on my XFS mount, which
> gets snapshoted every hour. i believe XFS is more optimized for
> LOCKING kinda stuff, which is kinna more desired here. Again, I'm not
> a UNIX guy, so I've been taking expert (Eric's) advice all along.
>
> On Sat, Aug 30, 2008 at 8:02 AM, Hareem Haque <hareem...@gmail.com
> <mailto:hareem...@gmail.com>> wrote:
>
>
> Folks. A quick question. Which filesystem would you recommend i use. I
> only need to persistently store data. I would be needing mysql to run
> within EBS. Is XFS better or EXT3
>
> Regards
> Hareem.Haque
>
>
>
>
>
> Eric Hammond wrote:
> > Rodney:
> >
> > Excellent point. Thanks for catching this.
> >
> > I have updated the tutorial with a couple lines to fix mysql file
> > ownership in the event any other users were created before the
> mysql-
> > server package was installed.
> >

> > http://ec2ebs-mysql.notlong.com <http://ec2ebs-mysql.notlong.com/>
> >
> > Thanks,
> > --
> > Eric Hammond
> > http://www.anvilon.com <http://www.anvilon.com/>


> >
> > On Aug 25, 7:28 am, RodneyQ <imco...@gmail.com

RodneyQ

unread,
Sep 1, 2008, 4:59:08 AM9/1/08
to ec2ubuntu

> - is there any way to detect the 'attached vol-id' in the EC2 instance?

I think the command ec2-describe-volumes can return these values.
ec2-describe-volumes | grep i-111111 i.e i-11111 is the instance id

Output: ATTACHMENT vol-1025c079 i-5b72a932 /dev/sdh attached
2008-08-22T09:34:05+0000

If used inside a startup script, that would be someting like:

INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
VOL_ID=$(ec2-describe-volumes | grep $INSTANCE_ID | awk '{ print
$2 }')

The variable VOL_ID contains the volume id connected to the current
instance(assuming only a single volume is connected to the instance)
Hope this helps.

Rodney
Reply all
Reply to author
Forward
0 new messages