Dave,

Instance's local IP could be fetched by URL
http://169.254.169.254/latest/meta-data/local-ipv4, our using the
ec2_get_local_ip routine from /usr/local/aws/lib/lib.sh.

There is another way: in /etc/aws/host.conf config there is a variable
"MYSQL_ROLE" (on MySQL instances only), which will be set either to
"master" or "slave".

Nick

2009/8/21 dave <[email protected]>:
>
> A huge help, got the script to work now with no intervention...
>
> Another small issue if I may. I want to run this rsync script every 5
> minutes or so but I only want it to run on the master server... It is
> a mysql instance, so it will be either master or slave. How would I
> get this information in a sh script?
>
> I could query the /etc/aws/hosts/<role>-master and check it against
> the servers ip (dont know how to get the servers ip :( ) and then
> point the rsync script to each in the /etc/aws/hosts/<role>-slave dir.
>
> Any thoughts
>
> Best
> Dave
>
> On Aug 21, 12:13 pm, Nickolas Toursky <[email protected]> wrote:
>> Dave,
>>
>> For example, the private key (used for authentication) is stored on
>> the server as '/usr/local/ident.pk' (so it will survive sync to all),
>> public key is distributed across other servers using some sort of
>> script, which will add this public key to /root/.ssh/authorized_keys
>> file during host initialization.
>>
>> To authenticate using the key file different than /root/.ssh/id_rsa,
>> use 'ssh -i /path/to/key.pk' (in the case of rsync - ' rsync -e "ssh
>> -i /path/to/key.pk"').
>>
>> Hope this will help you to implement what do you wish.
>>
>> Nick
>>
>> 2009/8/21 dave <[email protected]>:
>>
>>
>>
>> > Sorry, I've made a lot of headway in linux administration but some
>> > things still go over my head.
>>
>> > I am not sure how I would create a keypair that would go from the
>> > master server and then to all slave servers (based on the same image),
>> > especially as the root/.ssh dir is not transferred in the sync to all
>> > process.
>>
>> > A little guidance would be hugely appreciated :)
>>
>> > Best
>> > Dave
>>
>> > On Aug 20, 5:59 pm, Nickolas Toursky <[email protected]> wrote:
>> >> Dave,
>>
>> >> You are free to use public key authentication on your instances.
>> >> I'd suggest you to create your own keypair instead of using the key
>> >> used by Scalr.
>>
>> >> A good manual:http://sial.org/howto/openssh/publickey-auth/
>>
>> >> Nick
>>
>> >> 2009/8/20 dave <[email protected]>:
>>
>> >> > How do I write an RSync script to syncronise certain directories
>> >> > across a role.
>>
>> >> > I have written a basic script but it is asking for a password every
>> >> > time it is run, is there a way to use the ssh keys?
>>
>> >> > Dave
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/scalr-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to