- Chef:Powerful Infrastructure Automation
- John Ewart Matthias Marschall Earl Waud
- 362字
- 2021-07-09 21:06:36
Provisioning EC2 instances
Here, we will be provisioning instances in us-west-1
, but depending on where you have your AWS instances set up, you will need to change your knife.rb
configuration to specify the region of your choice.
In order for them to communicate securely, we will construct a security group so that all traffic between them is permitted. This is outside the scope of this book, but it would be something to make sure you configure for production systems, as you probably do not want the public on the Internet to have direct access to your database server.
Here, we will assume that you have your AWS credentials and other critical components configured, as we covered in previous chapters.
To provision our database server, we will use the following command:
knife ec2 server create -d ubuntu14.04 -I ami-ee4f77ab -f m1.small -Z us-west-1a -S jewartec2 -N db00 --ssh-user ubuntu
And to provision the web server, we will use the following command:
knife ec2 server create -d ubuntu14.04 -I ami-ee4f77ab -f m1.small -Z us-west-1a -S jewartec2 -N web00 --ssh-user ubuntu
Once your instances are up and running, you can now move on to configuring them with the roles and configuration data required!
Configuring the database host
In order to apply the PostgreSQL role to our database host, we need to make sure it's in the run list. We can accomplish this with the following command:
knife node run_list add db00 "role[base_server]" knife node run_list add db00 "role[postgresql_server]"
After ensuring that your node has the base_server
and postgresql_server
roles added to the run list, you can run chef-client
on the newly created host:
[jewart]% knife ssh 'name:db00' -x ubuntu 'sudo chef-client'
Once this is complete, assuming that everything went well, your new EC2 instance will have:
Now that we have our database server configured, which can be verified by logging onto the server and ensuring that the service is running, let's take a look at setting up our web application.
- Instant Raspberry Pi Gaming
- Introduction to DevOps with Kubernetes
- Practical Data Wrangling
- 計算機原理
- Getting Started with Containerization
- IoT Penetration Testing Cookbook
- 自主研拋機器人技術(shù)
- STM32嵌入式微控制器快速上手
- 內(nèi)模控制及其應(yīng)用
- 新編計算機圖形學(xué)
- 空間機械臂建模、規(guī)劃與控制
- Flink原理與實踐
- Excel 2007終極技巧金典
- Linux Shell Scripting Cookbook(Third Edition)
- Linux常用命令簡明手冊