simonso
simonso

Reputation: 595

Modify datastax cassandra ami startup script

I am exploring the possibility of modifying https://github.com/riptano/ComboAMI to support Ec2MultiRegionSnitch.

In that:

  1. Add option --snitch Ec2MultiRegionSnitch -> modify cassandra.yaml to write snitch as multi region
  2. Add option --broadcast_address_as_public_ip yes -> modify cassandra.yaml to write broadcast_address: public_ip
  3. Add option --seeds 100.222.111.222, so as the newly created instances can join an existing cassandra, e.g. 100.222.111.222.

Tested the settings and worked.

The restrictions

  1. I can't copy the datastax ami to be my own ami.
  2. I can't snapshot an existing datastax cassandra instance into an AMI, such that I modify the script locally to get it launched.

The question:

  1. How to modify the script and test it out.
  2. Should I use AutoScalingGroup with a Launchconfiguration to point to this AMI, then use sed to modify the cassandra.yaml, service restart cassandra instead? It is not obvious to me how to run a script after the AWS launch configuration has completed launching the instance, especially I can't get the AWS::Instances::GetAtt PublicIP for the broadcast address. Ideally speaking the changes should have been done during cassandra.yaml construction in the script, not after.

Thanks!

Upvotes: 0

Views: 182

Answers (1)

joaquincasares
joaquincasares

Reputation: 113

That's correct, the AMI has to be rebuilt on a clean image under your account. We have instructions here on how to do so:

https://github.com/riptano/ComboAMI/blob/2.5/presetup/setup.md

As far as the the AutoScalingGroup question, I'm not sure how beneficial that would be. If you create your own image, off your own repo, feel free to create a pull request and I'll look them over to merge them into the official AMI.

Upvotes: 1

Related Questions