How to update Nginx config file on many identical servers at the same time?
We've got a fleet of Nginx servers on EC2 where we occasionally need to update the config files to implement new settings. Currently we have the configs in a custom AMI and if we need to update we have to rebuild the AMI and then EC2 instances. We've got some helper scripts but it's still quite an effort to do that and we are looking if there is some better way?
amazon-web-services amazon-ec2
New contributor
add a comment |
We've got a fleet of Nginx servers on EC2 where we occasionally need to update the config files to implement new settings. Currently we have the configs in a custom AMI and if we need to update we have to rebuild the AMI and then EC2 instances. We've got some helper scripts but it's still quite an effort to do that and we are looking if there is some better way?
amazon-web-services amazon-ec2
New contributor
2
ansible, saltstack to name a few.
– poige
4 hours ago
add a comment |
We've got a fleet of Nginx servers on EC2 where we occasionally need to update the config files to implement new settings. Currently we have the configs in a custom AMI and if we need to update we have to rebuild the AMI and then EC2 instances. We've got some helper scripts but it's still quite an effort to do that and we are looking if there is some better way?
amazon-web-services amazon-ec2
New contributor
We've got a fleet of Nginx servers on EC2 where we occasionally need to update the config files to implement new settings. Currently we have the configs in a custom AMI and if we need to update we have to rebuild the AMI and then EC2 instances. We've got some helper scripts but it's still quite an effort to do that and we are looking if there is some better way?
amazon-web-services amazon-ec2
amazon-web-services amazon-ec2
New contributor
New contributor
edited 4 hours ago
Bububu
New contributor
asked 4 hours ago
BububuBububu
1134
1134
New contributor
New contributor
2
ansible, saltstack to name a few.
– poige
4 hours ago
add a comment |
2
ansible, saltstack to name a few.
– poige
4 hours ago
2
2
ansible, saltstack to name a few.
– poige
4 hours ago
ansible, saltstack to name a few.
– poige
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
There's a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every config change. Just in a fully automated way.
As you're now doing config updates through AMIs you take this one step further and create a pipeline that, upon a config file change in some repository, will:
- Automatically build a new AMI - one of the most popular tools to do that is Packer
- Automatically rebuild your Nginx fleet - you should already have all the Nginx servers in an Auto-Scaling Group with an Application Load Balancer in front. If you don't you should as it will make the update as simple as updating the ASG Launch Configuration and waiting for the instances to get re-built from the new AMI.
Second option is to keep the instances in place and only deploy the config files, without rebuilding them. Generally you can treat config files as a code and deploy your config changes the same way you would deploy code releases. AWS has many tools to help with that.
AWS Elastic Beanstalk that uses Chef internally and you can script your Nginx updates this way.
AWS Code Deploy which is a fully scriptable deployment tool that integrates well with other parts of the AWS Code Suite:
Code Commit where you can keep your Nginx config files in GIT.
Code Pipeline that can automatically trigger the deployment whenever a config file is updated in Code Commit.
Ansible or Puppet which are popular non-AWS tools that can help you keep all the servers configured the same way.
Once you're comfortable with automating these Nginx config updates you may want to extend the automation to the rest of your infrastructure.
There is a great whitepaper Overview of Deployment Options on AWS that will give you a nice overview.
Hope that helps :)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Bububu is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f949082%2fhow-to-update-nginx-config-file-on-many-identical-servers-at-the-same-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There's a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every config change. Just in a fully automated way.
As you're now doing config updates through AMIs you take this one step further and create a pipeline that, upon a config file change in some repository, will:
- Automatically build a new AMI - one of the most popular tools to do that is Packer
- Automatically rebuild your Nginx fleet - you should already have all the Nginx servers in an Auto-Scaling Group with an Application Load Balancer in front. If you don't you should as it will make the update as simple as updating the ASG Launch Configuration and waiting for the instances to get re-built from the new AMI.
Second option is to keep the instances in place and only deploy the config files, without rebuilding them. Generally you can treat config files as a code and deploy your config changes the same way you would deploy code releases. AWS has many tools to help with that.
AWS Elastic Beanstalk that uses Chef internally and you can script your Nginx updates this way.
AWS Code Deploy which is a fully scriptable deployment tool that integrates well with other parts of the AWS Code Suite:
Code Commit where you can keep your Nginx config files in GIT.
Code Pipeline that can automatically trigger the deployment whenever a config file is updated in Code Commit.
Ansible or Puppet which are popular non-AWS tools that can help you keep all the servers configured the same way.
Once you're comfortable with automating these Nginx config updates you may want to extend the automation to the rest of your infrastructure.
There is a great whitepaper Overview of Deployment Options on AWS that will give you a nice overview.
Hope that helps :)
add a comment |
There's a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every config change. Just in a fully automated way.
As you're now doing config updates through AMIs you take this one step further and create a pipeline that, upon a config file change in some repository, will:
- Automatically build a new AMI - one of the most popular tools to do that is Packer
- Automatically rebuild your Nginx fleet - you should already have all the Nginx servers in an Auto-Scaling Group with an Application Load Balancer in front. If you don't you should as it will make the update as simple as updating the ASG Launch Configuration and waiting for the instances to get re-built from the new AMI.
Second option is to keep the instances in place and only deploy the config files, without rebuilding them. Generally you can treat config files as a code and deploy your config changes the same way you would deploy code releases. AWS has many tools to help with that.
AWS Elastic Beanstalk that uses Chef internally and you can script your Nginx updates this way.
AWS Code Deploy which is a fully scriptable deployment tool that integrates well with other parts of the AWS Code Suite:
Code Commit where you can keep your Nginx config files in GIT.
Code Pipeline that can automatically trigger the deployment whenever a config file is updated in Code Commit.
Ansible or Puppet which are popular non-AWS tools that can help you keep all the servers configured the same way.
Once you're comfortable with automating these Nginx config updates you may want to extend the automation to the rest of your infrastructure.
There is a great whitepaper Overview of Deployment Options on AWS that will give you a nice overview.
Hope that helps :)
add a comment |
There's a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every config change. Just in a fully automated way.
As you're now doing config updates through AMIs you take this one step further and create a pipeline that, upon a config file change in some repository, will:
- Automatically build a new AMI - one of the most popular tools to do that is Packer
- Automatically rebuild your Nginx fleet - you should already have all the Nginx servers in an Auto-Scaling Group with an Application Load Balancer in front. If you don't you should as it will make the update as simple as updating the ASG Launch Configuration and waiting for the instances to get re-built from the new AMI.
Second option is to keep the instances in place and only deploy the config files, without rebuilding them. Generally you can treat config files as a code and deploy your config changes the same way you would deploy code releases. AWS has many tools to help with that.
AWS Elastic Beanstalk that uses Chef internally and you can script your Nginx updates this way.
AWS Code Deploy which is a fully scriptable deployment tool that integrates well with other parts of the AWS Code Suite:
Code Commit where you can keep your Nginx config files in GIT.
Code Pipeline that can automatically trigger the deployment whenever a config file is updated in Code Commit.
Ansible or Puppet which are popular non-AWS tools that can help you keep all the servers configured the same way.
Once you're comfortable with automating these Nginx config updates you may want to extend the automation to the rest of your infrastructure.
There is a great whitepaper Overview of Deployment Options on AWS that will give you a nice overview.
Hope that helps :)
There's a number of concepts that you can leverage.
The key to success is automation
First option is to keep doing what you're doing now, i.e. rebuild the EC2s with every config change. Just in a fully automated way.
As you're now doing config updates through AMIs you take this one step further and create a pipeline that, upon a config file change in some repository, will:
- Automatically build a new AMI - one of the most popular tools to do that is Packer
- Automatically rebuild your Nginx fleet - you should already have all the Nginx servers in an Auto-Scaling Group with an Application Load Balancer in front. If you don't you should as it will make the update as simple as updating the ASG Launch Configuration and waiting for the instances to get re-built from the new AMI.
Second option is to keep the instances in place and only deploy the config files, without rebuilding them. Generally you can treat config files as a code and deploy your config changes the same way you would deploy code releases. AWS has many tools to help with that.
AWS Elastic Beanstalk that uses Chef internally and you can script your Nginx updates this way.
AWS Code Deploy which is a fully scriptable deployment tool that integrates well with other parts of the AWS Code Suite:
Code Commit where you can keep your Nginx config files in GIT.
Code Pipeline that can automatically trigger the deployment whenever a config file is updated in Code Commit.
Ansible or Puppet which are popular non-AWS tools that can help you keep all the servers configured the same way.
Once you're comfortable with automating these Nginx config updates you may want to extend the automation to the rest of your infrastructure.
There is a great whitepaper Overview of Deployment Options on AWS that will give you a nice overview.
Hope that helps :)
answered 3 hours ago
MLuMLu
6,78211739
6,78211739
add a comment |
add a comment |
Bububu is a new contributor. Be nice, and check out our Code of Conduct.
Bububu is a new contributor. Be nice, and check out our Code of Conduct.
Bububu is a new contributor. Be nice, and check out our Code of Conduct.
Bububu is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f949082%2fhow-to-update-nginx-config-file-on-many-identical-servers-at-the-same-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
ansible, saltstack to name a few.
– poige
4 hours ago