3 ms·
Well, the best way to learn is to actually do something. Create a small service in your favourite framework. Something really small, an echo service will probab
by oblio 9y ago
Well, the best way to learn is to actually do something. Create a small service in your favourite framework. Something really small, an echo service will probably suffice.
Then stop "developing" and switch on "Ops mode".
Automate:
- builds (build & packaging scripts)
- deployments - try all 3 major approaches:
- push deployment: running a command on a central server that orchestrates everything (Ansible, Salt, chef-solo, ...)
- pull deployment: agents running on your target server, that pull the latest changes (Chef, Puppet, ...)
- immutable infrastructure: VMs or containers that are never modified, only recreated (CloudFormation, Docker, ...)
include database updates in your deployment orchestration and possibly include even environment pre-warming/pre-caching
- functional tests, especially fast smoke tests
Add:
- high availability/load balancing (Nginx, HAProxy, Apache, Elastic Load Balancer)
- detailed technical monitoring and graphing (Nagios, Zabbix, Cloudwatch)
- availability monitoring (Pingdom)
- a status page (can't give you a decent example; you can build your own, but host it somewhere else than your main "app")
- log collection and shipping (Splunk, Graylog)
Basically, for almost everything I listed google options and pick an "Ops stack". Then implement that as best you can.
Oh, and by the way, while working on the "Ops stack", only "develop" things in support of this Ops work in your "app".
- toomuchtodo 9y ago> - a status page (can't give you a decent example; you can build your own, but host it somewhere else than your main "app") Does statuspage.io have free trial accounts? Integrate with them for your demo/trial using API calls. Bonus points if you pull in applications metrics to your status page (response time, etc).
- zeckalpha 9y agoNo. They start at $29/month
- falcolas 9y agoThe only thing I'd add is be sure to do it manually first - you'll need the solid foundation of understanding how it works (and how it fails) in order to automate it. Note the key word - understanding - and how that means that just googling the steps won't help you in the long run. Set up & configure Jenkins to pull and build. Set up and configure nginx, MySQL/PostgreSQL, init files for your app, iptables to firewall off unnecessary ports, DNS, and LetsEncrypt SSL certs (and the associated nginx configs). Make sure nothing that doesn't need to be is running as root. Make sure that what is running needs to be running, and nothing else. Then, start automating it. Toss in cloud features like ELBs, RDS instances, cloudformation (or terraform, etc), autoscaling groups, autoscaling container services, etc. This will take you a very long time (and you will probably have enough skills to be hired as a "DevOps" engineer well before you're done), especially if you strive for understanding. But it's really the only way to get where you want to get and be good at it.
- collyw 9y agoWhile I agree that learning by doing is the best way to start, once you get beyond the basics its nice to have some patterns and best practices outlined so you can try to do things more "properly".
- vacri 9y agoFriends don't let friends configure Nagios...
- oblio 9y agoHow is he supposed to learn the Ops part of DevOps without pain and suffering? :D
- busterarm 9y ago> - log collection and shipping (Splunk, Graylog) I'll also throw my hat in for setting up (and securing, without Shield) an ELK stack here. You'll learn a lot along the way.
- oblio 9y agoI forgot to mention 3 very important things "to add": - security (you should already know a great deal from your work as a developer, the general things such as no open ports, no plain text passwords, etc.) - related to security: secret management (Chef, Puppet - I think, Vault) - backups, backups, backups: for the database and basically anything which is not reproducible from source (which in general should only be your database data)
- rob-olmos 9y agoInteresting only one comment made a clear call to backups. Strongly second the notion of backups as a high priority to learn and implement. Could make it more "devops-y" by also automating the verification of them with restores/testing.
- jankedeen 9y agoThese have packaged the process and tools but no one can tell you how to do it for yourself. Because at up to an expert level it is still a set of tools you use. A lot of the advice/terminology: 'fast smoke tests', 'google ops stack', 'host your status page elsewhere', choice of load balancers, etc.. is stupid-hoc. Do yourself a favor if you are going to do devops practice. 1. Write it from scratch. 2. Make it work no matter what happens before and after calamity. 3. Write the docs. 4. Leave it to beaver.
- theossuary 9y agoThere's two major types of monitoring you should be concerned with, log aggregation and metrics collection. For log aggregation the most mature open-source solution I know of is the ELK stack (Elasticsearch for storage, Logstash for aggregation, Kibana for visualization). Set that up (bonus points if you use Puppet/Chef/Ansible/Whatever to set it up for you), and make sure you can detect anomalies from your visualization interface. For metrics collection, Prometheus has a special place in my heart, I love its architecture. That said there are quite a few options, InfluxDB is another (arguably simpler) option. You can then use something like Grafana to visualize the metrics. For configuration management tools, Chef is complicated and you better know Ruby and have a few months to dig into it. Puppet is simpler, but has a lot of weird quirks. Ansible is simple, but not as powerful (or used); so pick your poison, they all are pretty similar conceptually. Basically at the end of your journey you should be able to kill any server (or network connection, or application running on a server) and be alerted to it in near realtime. You should be able to diagnose what's wrong quickly using Kibana and Grafana, and finally you should be able to destroy and recreate the server using a few well understood commands and have it be completely reconfigured and ready to accept connections. Of course this is pie in the sky (like having perfect unit/integration testing for a very large application), but that should be the goal.
- bradknowles 9y agoWith respect, Puppet is push-based, not pull-based. Chef is pull-based by default, but you can also use it in a push-oriented manner. Having worked with both Chef and Puppet, it is my opinion that Chef is the more scalable of the two, and the one that makes more logical sense to me. YMMV.