Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision |
opennic:infra:wiki [2017-07-19T21:22:08Z] – fusl | opennic:infra:wiki [2017-10-18T15:17:40Z] – fusl |
---|
====== wiki.opennic.org infrastructure ====== | ====== wiki.opennic.org infrastructure ====== |
The wiki.opennic.org website runs on [[https://aws.amazon.com/|Amazon Web Services (AWS)]] infrastructure and uses various services offered by AWS: | ==== Maintainers ==== |
| - [[/user/fusl]] |
| |
===== Elastic File System ===== | ===== The Infrastructure ===== |
| The wiki.opennic.org website runs on [[https://aws.amazon.com/|Amazon Web Services (AWS)]] infrastructure and uses various services offered by AWS in the us-east-1 (US East (N. Virginia)) [[http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html|region]]: |
| |
| ==== Elastic File System ==== |
The [[https://aws.amazon.com/efs/|EFS service]] is used to store all wiki pages, configurations, attachments, etc. on a scalable, shared filesystem using NFS as protocol. | The [[https://aws.amazon.com/efs/|EFS service]] is used to store all wiki pages, configurations, attachments, etc. on a scalable, shared filesystem using NFS as protocol. |
| |
* Endpoint: ''fs-ee48faa7.efs.us-east-1.amazonaws.com'' | * Endpoint: ''fs-ee48faa7.efs.us-east-1.amazonaws.com'' |
| |
===== ElastiCache ===== | ==== ElastiCache ==== |
[[https://aws.amazon.com/elasticache/|ElastiCache]] stores all PHP sessions in a single Memcached instance to ensure session and login-state persistency and reliability across all floating wiki.opennic.org webserver instances. | [[https://aws.amazon.com/elasticache/|ElastiCache]] stores all PHP sessions in a single Memcached instance to ensure session and login-state persistency and reliability across all floating wiki.opennic.org webserver instances. |
| |
* Endpoint: ''prod-wiki-sess.xqtznt.cfg.use1.cache.amazonaws.com:11211'' | * Endpoint: ''prod-wiki-sess.xqtznt.cfg.use1.cache.amazonaws.com:11211'' |
| |
===== Auto Scaling ===== | ==== Auto Scaling ==== |
To automatically scale the wiki instances to the desired performance and to ensure reliability even on instance failures, we use an [[https://aws.amazon.com/autoscaling/|Auto Scaling]] group which handles automatic scaling at your desire. | To automatically scale the wiki instances to the desired performance and to ensure reliability even on instance failures, we use an [[https://aws.amazon.com/autoscaling/|Auto Scaling]] group which handles automatic scaling at your desire. |
| |
==== Details ==== | === Details === |
* Auto Scaling Group: ''prod-wiki'' | * Auto Scaling Group: ''prod-wiki'' |
* Launch Configuration: ''prod-wiki-20170506-4'' | * Launch Configuration: ''prod-wiki-20170909'' |
* Load Balancers: - | * Load Balancers: - |
* Target Groups: ''prod-wiki'' | * Target Groups: ''prod-wiki'' |
* Instance Protection: - | * Instance Protection: - |
| |
==== Scaling Policies ==== | === Scaling Policies === |
=== prod-wiki-high === | == prod-wiki-high == |
* Policy type: ''Simple scaling'' | * Policy type: ''Simple scaling'' |
* Execute policy when: ''prod-wiki-high'' (breaches the alarm threshold: ''TargetResponseTime >= 1'' for *300* seconds for the metric dimensions ''LoadBalancer = app/prod-wiki/0ec4b8b4601b350c'') | * Execute policy when: ''prod-wiki-high'' (breaches the alarm threshold: ''TargetResponseTime >= 1'' for ''300'' seconds for the metric dimensions ''LoadBalancer = app/prod-wiki/0ec4b8b4601b350c'') |
* Take the action: ''Add 2 instances'' | * Take the action: ''Add 2 instances'' |
* And then wait: ''180 seconds before allowing another scaling activity'' | * And then wait: ''180 seconds before allowing another scaling activity'' |
| |
=== prod-wiki-low === | == prod-wiki-low == |
* Policy type: ''Simple scaling'' | * Policy type: ''Simple scaling'' |
* Execute policy when: ''prod-wiki-low'' (breaches the alarm threshold: ''TargetResponseTime <= 0.5'' for *300* seconds for the metric dimensions ''LoadBalancer = app/prod-wiki/0ec4b8b4601b350c'') | * Execute policy when: ''prod-wiki-low'' (breaches the alarm threshold: ''TargetResponseTime <= 0.5'' for ''300'' seconds for the metric dimensions ''LoadBalancer = app/prod-wiki/0ec4b8b4601b350c'') |
* Take the action: ''Remove 1 instances'' | * Take the action: ''Remove 1 instances'' |
* And then wait: ''180 seconds before allowing another scaling activity'' | * And then wait: ''180 seconds before allowing another scaling activity'' |
| |
==== Tags ==== | === Tags === |
^ Key ^ Value ^ Tag New Instances ^ | ^ Key ^ Value ^ Tag New Instances ^ |
| Name | prod-wiki | Yes | | | Name | prod-wiki | Yes | |
| |
==== Launch Configuration ==== | === Launch Configuration === |
* AMI: ''ami-80861296'' | * AMI: //AMI created by [[https://github.com/opennic/packers/tree/master/opennic-wiki|opennic-wiki packer]]// |
* Instance type: ''t2.nano'' (t2.nano (Variable ECUs, 1 vCPUs, 2.4 GHz, Intel Xeon Family, 0.5 GiB memory, EBS only)) | * Instance type: ''t2.nano'' (t2.nano (Variable ECUs, 1 vCPUs, 2.4 GHz, Intel Xeon Family, 0.5 GiB memory, EBS only)) |
* Name: ''prod-wiki-20170506-4'' | * Name: ''prod-wiki-20170506-4'' |
* Kernel ID: ''Use default'' | * Kernel ID: ''Use default'' |
* RAM Disk ID: ''Use default'' | * RAM Disk ID: ''Use default'' |
* User data (As text): {{:opennic:infra:prod-wiki-asg-user-data.txt|}} | * User data (As text): - |
* IP Address Type: ''Assign a public IP address to every instance.'' | * IP Address Type: ''Assign a public IP address to every instance.'' |
* Storage | * Storage |
* Security group: ''sg-3eccfc41'' | * Security group: ''sg-3eccfc41'' |
| |
===== Elastic Load Balancer ===== | ==== Elastic Load Balancer ==== |
An [[https://aws.amazon.com/elasticloadbalancing/|Elastic Load Balancer]] distributes HTTP queries to wiki.opennic.org across all instances in the auto scaling group. | An [[https://aws.amazon.com/elasticloadbalancing/|Elastic Load Balancer]] distributes HTTP queries to wiki.opennic.org across all instances in the auto scaling group. |
| |
* Is: ''<='' ''500'' | * Is: ''<='' ''500'' |
* For at least: ''1'' consecutive period(s) of ''5 Minutes'' | * For at least: ''1'' consecutive period(s) of ''5 Minutes'' |
| ==== git sync ==== |
| The entire web root directory is synced to [[https://github.com/opennic/wikipages|GitHub]] approximately every 60 minutes using a [[https://github.com/opennic/packers/blob/master/opennic-wiki/files-pre/etc/cron.hourly/gitsync|crontab script]] deployed when building the AWS AMI using our [[https://github.com/opennic/packers/tree/master/opennic-wiki|Packer deployment definitions]]. Some files are [[https://github.com/opennic/wikipages/blob/master/.gitignore|not synced]] to the repository. |