Changing IP address for Cloudera in EC2 EBS instan

2019-04-13 07:48发布

问题:

I have cloudera installed in one m1.large instance . I was able install it successfully. But once i stop the instance and start it again next morning the IP changes and cloudera still refers to old IP and none of the services run . How can i solve this problem because i can not keep instance up whole day?

Since its for academic purpose and I don't have a budget .

回答1:

This doesn't really have anything to do with Cloudera -- more the behavior of EC2 Instances. The feature you're looking for is called an Elastic IP Address, which is a static IP address that you can assign to your EC2 instance. Elastic IP behavior has some differences in EC2-Classic and EC2-VPC, noted here. Most notably for you will be instance startup behavior regarding Elastic IP addresses, which I'll get to shortly.

You can find details on Elastic IP pricing here. Note that while your first Elastic IP address (associated with a running instance is free), you will be charged by the hour for the time that your instance is offline and you still have the Elastic IP Address. This rate is "$0.005 per Elastic IP address not associated with a running instance per hour on a pro rata basis." So not very expensive, but there is some expense to be aware of.

Another recent question has a couple of good answers on how to allocate the Elastic IP address on instance startup. In EC2-Classic you will need to script it or do it manually. In VPC the Elastic IP will remain associated with the instance. (I think you're still charged the fee, though, per this documentation claiming that a small hourly fee is charged if an Elastic IP is associated with a stopped instance.)


If any expensive is prohibitive, I would recommend looking into AWS Command Line Interface to get the new public IP of the EC2 instance on startup and writing a script to change that IP address in your configuration.



回答2:

You can setup your machine inside a VPC:

By launching your instances into a VPC instead of EC2-Classic, you gain the ability to:

  • Assign static private IP addresses to your instances that persist across starts and stops