logs.nimbus: migrate to Hetzner metal hosts

For better performance, lower prices, and better network utilization.

https://github.com/status-im/infra-nimbus/issues/84

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-02-03 21:38:55 +01:00
parent 761b0d7e2b
commit ade0a50a53
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
7 changed files with 31 additions and 47 deletions

View File

@ -28,6 +28,7 @@ es_lb_image: 'elasticsearch:7.14.2'
es_lb_cont_name: elasticsearch-lb
es_lb_data_center: do-ams3
es_lb_cluster_name: 'nimbus-logs-search'
es_lb_cluster_dc: 'he-eu-hel1'
es_lb_api_port: 9200
es_lb_node_port: 9300
@ -63,5 +64,5 @@ open_ports_default_chain: 'VPN'
open_ports_list:
- { port: 80, chain: 'SERVICES', protocol: 'tcp', comment: 'Kiban & Grafana'}
- { port: 443, chain: 'SERVICES', protocol: 'tcp', comment: 'Kiban & Grafana' }
- { port: '{{ es_lb_api_port }}', ipset: 'log-store.nimbus' }
- { port: '{{ es_lb_node_port }}', ipset: 'log-store.nimbus' }
- { port: '{{ es_lb_api_port }}', ipset: 'logs.nimbus' }
- { port: '{{ es_lb_node_port }}', ipset: 'logs.nimbus' }

View File

@ -59,10 +59,10 @@ open_ports_default_chain: 'VPN'
open_ports_list:
- { port: 80, protocol: 'tcp', chain: 'SERVICES' }
- { port: 443, protocol: 'tcp', chain: 'SERVICES' }
- { port: '{{ es_api_port }}', ipset: 'log-store.nimbus' }
- { port: '{{ es_api_port }}', ipset: 'logs.nimbus' }
- { port: '{{ es_api_port }}', ipset: 'dash.nimbus' }
- { port: '{{ es_api_port }}', ipset: 'log-aggr.hq' }
- { port: '{{ es_node_port }}', ipset: 'log-store.nimbus' }
- { port: '{{ es_node_port }}', ipset: 'logs.nimbus' }
- { port: '{{ es_node_port }}', ipset: 'dash.nimbus' }
- { port: '{{ es_metrics_cont_port }}', ipset: 'metrics.hq' }

View File

@ -18,12 +18,12 @@ metal-04.he-eu-hel1.nimbus.pyrmont hostname=metal-04.he-eu-hel1.nimbus.pyrmont a
metal-05.he-eu-hel1.nimbus.mainnet hostname=metal-05.he-eu-hel1.nimbus.mainnet ansible_host=135.181.60.177 env=nimbus stage=mainnet data_center=he-eu-hel1 region=eu-hel1 dns_entry=metal-05.he-eu-hel1.nimbus.mainnet.statusim.net
metal-06.he-eu-hel1.nimbus.mainnet hostname=metal-06.he-eu-hel1.nimbus.mainnet ansible_host=135.181.56.50 env=nimbus stage=mainnet data_center=he-eu-hel1 region=eu-hel1 dns_entry=metal-06.he-eu-hel1.nimbus.mainnet.statusim.net
node-01.aws-eu-central-1a.dash.nimbus hostname=node-01.aws-eu-central-1a.dash.nimbus ansible_host=52.28.100.116 env=dash stage=nimbus data_center=aws-eu-central-1a region=eu-central-1a dns_entry=node-01.aws-eu-central-1a.dash.nimbus.statusim.net
node-01.aws-eu-central-1a.log-store.nimbus hostname=node-01.aws-eu-central-1a.log-store.nimbus ansible_host=35.157.196.157 env=log-store stage=nimbus data_center=aws-eu-central-1a region=eu-central-1a dns_entry=node-01.aws-eu-central-1a.log-store.nimbus.statusim.net
node-02.aws-eu-central-1a.log-store.nimbus hostname=node-02.aws-eu-central-1a.log-store.nimbus ansible_host=3.64.111.246 env=log-store stage=nimbus data_center=aws-eu-central-1a region=eu-central-1a dns_entry=node-02.aws-eu-central-1a.log-store.nimbus.statusim.net
node-03.aws-eu-central-1a.log-store.nimbus hostname=node-03.aws-eu-central-1a.log-store.nimbus ansible_host=18.156.65.18 env=log-store stage=nimbus data_center=aws-eu-central-1a region=eu-central-1a dns_entry=node-03.aws-eu-central-1a.log-store.nimbus.statusim.net
stable-large-01.aws-eu-central-1a.nimbus.prater hostname=stable-large-01.aws-eu-central-1a.nimbus.prater ansible_host=3.120.202.252 env=nimbus stage=prater data_center=aws-eu-central-1a region=eu-central-1a dns_entry=stable-large-01.aws-eu-central-1a.nimbus.prater.statusim.net
stable-small-01.aws-eu-central-1a.nimbus.mainnet hostname=stable-small-01.aws-eu-central-1a.nimbus.mainnet ansible_host=3.120.104.18 env=nimbus stage=mainnet data_center=aws-eu-central-1a region=eu-central-1a dns_entry=stable-small-01.aws-eu-central-1a.nimbus.mainnet.statusim.net
stable-small-02.aws-eu-central-1a.nimbus.mainnet hostname=stable-small-02.aws-eu-central-1a.nimbus.mainnet ansible_host=3.64.117.223 env=nimbus stage=mainnet data_center=aws-eu-central-1a region=eu-central-1a dns_entry=stable-small-02.aws-eu-central-1a.nimbus.mainnet.statusim.net
store-01.he-eu-hel1.logs.nimbus hostname=store-01.he-eu-hel1.logs.nimbus ansible_host=65.108.129.55 env=logs stage=nimbus data_center=he-eu-hel1 region=eu-hel1 dns_entry=store-01.he-eu-hel1.logs.nimbus.statusim.net
store-02.he-eu-hel1.logs.nimbus hostname=store-02.he-eu-hel1.logs.nimbus ansible_host=65.108.129.56 env=logs stage=nimbus data_center=he-eu-hel1 region=eu-hel1 dns_entry=store-02.he-eu-hel1.logs.nimbus.statusim.net
store-03.he-eu-hel1.logs.nimbus hostname=store-03.he-eu-hel1.logs.nimbus ansible_host=65.108.129.57 env=logs stage=nimbus data_center=he-eu-hel1 region=eu-hel1 dns_entry=store-03.he-eu-hel1.logs.nimbus.statusim.net
testing-large-01.aws-eu-central-1a.nimbus.prater hostname=testing-large-01.aws-eu-central-1a.nimbus.prater ansible_host=3.65.99.236 env=nimbus stage=prater data_center=aws-eu-central-1a region=eu-central-1a dns_entry=testing-large-01.aws-eu-central-1a.nimbus.prater.statusim.net
unstable-large-01.aws-eu-central-1a.nimbus.prater hostname=unstable-large-01.aws-eu-central-1a.nimbus.prater ansible_host=3.65.85.130 env=nimbus stage=prater data_center=aws-eu-central-1a region=eu-central-1a dns_entry=unstable-large-01.aws-eu-central-1a.nimbus.prater.statusim.net
windows-01.gc-us-central1-a.nimbus.prater hostname=windows-01.gc-us-central1-a.nimbus.prater ansible_host=35.232.80.244 env=nimbus stage=prater data_center=gc-us-central1-a region=us-central1-a dns_entry=windows-01.gc-us-central1-a.nimbus.prater.statusim.net
@ -32,9 +32,6 @@ windows-01.gc-us-central1-a.nimbus.prater hostname=windows-01.gc-us-central1-a.n
goerli-01.aws-eu-central-1a.nimbus.geth
mainnet-01.aws-eu-central-1a.nimbus.geth
node-01.aws-eu-central-1a.dash.nimbus
node-01.aws-eu-central-1a.log-store.nimbus
node-02.aws-eu-central-1a.log-store.nimbus
node-03.aws-eu-central-1a.log-store.nimbus
stable-large-01.aws-eu-central-1a.nimbus.prater
stable-small-01.aws-eu-central-1a.nimbus.mainnet
stable-small-02.aws-eu-central-1a.nimbus.mainnet
@ -61,19 +58,17 @@ metal-04.he-eu-hel1.nimbus.mainnet
metal-04.he-eu-hel1.nimbus.pyrmont
metal-05.he-eu-hel1.nimbus.mainnet
metal-06.he-eu-hel1.nimbus.mainnet
store-01.he-eu-hel1.logs.nimbus
store-02.he-eu-hel1.logs.nimbus
store-03.he-eu-hel1.logs.nimbus
[log-dash]
node-01.aws-eu-central-1a.dash.nimbus
[log-store]
node-01.aws-eu-central-1a.log-store.nimbus
node-02.aws-eu-central-1a.log-store.nimbus
node-03.aws-eu-central-1a.log-store.nimbus
[log-store.nimbus]
node-01.aws-eu-central-1a.log-store.nimbus
node-02.aws-eu-central-1a.log-store.nimbus
node-03.aws-eu-central-1a.log-store.nimbus
[logs.nimbus]
store-01.he-eu-hel1.logs.nimbus
store-02.he-eu-hel1.logs.nimbus
store-03.he-eu-hel1.logs.nimbus
[ms-eu-dublin]
macos-01.ms-eu-dublin.nimbus.prater

View File

@ -11,7 +11,7 @@
- name: Configure ElasticSearch servers
become: true
hosts: log-store
hosts: logs.nimbus
roles:
- role: swap-file
tags: swap-file
@ -30,11 +30,11 @@
- name: Configure ElasticSearch servers
become: true
hosts: log-dash
hosts: dash.nimbus
pre_tasks:
- name: Fetch available elasticsearch nodes
uri:
url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ data_center }}&tag={{ es_lb_cluster_name }}'
url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ es_lb_cluster_dc }}&tag={{ es_lb_cluster_name }}'
register: es_services
- name: Extract ElasticSearch hostnames
set_fact:

View File

@ -16,7 +16,7 @@
- name: infra-role-bootstrap-linux
src: git@github.com:status-im/infra-role-bootstrap-linux.git
version: 95619730261b9fae8faf34da7e26c2f15d6e7be8
version: 31bf1de9c804d57e017554cfa9fc59b45b855c2c
scm: git
- name: infra-role-bootstrap-windows

34
logs.tf
View File

@ -1,35 +1,23 @@
module "nimbus_log_store_aws" {
source = "github.com/status-im/infra-tf-amazon-web-services"
module "nimbus_log_store" {
source = "./modules/dummy-module"
name = "node"
env = "log-store"
group = "log-store"
name = "store"
env = "logs"
stage = "nimbus"
group = "logs.nimbus"
domain = var.domain
/* Scaling */
host_count = var.log_stores_count
type = "t3a.medium" /* 4GB RAM at least */
data_vol_size = 200 /* We'll be storing TRACE logs */
data_vol_type = "st1" /* Change to gp2 for SSD */
/* Firewall */
open_tcp_ports = [
"80", /* HTTP */
"443", /* HTTPS */
ips = [
"65.108.129.55",
"65.108.129.56",
"65.108.129.57",
]
/* Plumbing */
vpc_id = module.nimbus_network.vpc.id
subnet_id = module.nimbus_network.subnets[0].id
secgroup_id = module.nimbus_network.secgroup.id
keypair_name = aws_key_pair.jakubgs.key_name
}
resource "cloudflare_record" "nimbus_log_store_aws" {
resource "cloudflare_record" "nimbus_log_store" {
zone_id = local.zones["status.im"]
name = "nimbus-es.infra"
value = module.nimbus_log_store_aws.public_ips[count.index]
value = module.nimbus_log_store.public_ips[count.index]
count = var.log_stores_count
type = "A"
proxied = true

View File

@ -1,7 +1,7 @@
output "hosts" {
value = merge(
module.nimbus_dashboard.hosts,
module.nimbus_log_store_aws.hosts,
module.nimbus_log_store.hosts,
module.nimbus_geth_goerli.hosts,
module.nimbus_geth_mainnet.hosts,
module.nimbus_nodes_mainnet_hetzner.hosts,