Compare commits
No commits in common. "4530a341759d65dc75772c8f4d309fc706fff0c9" and "12268daad6a3176969ca19fca2629dc545ca6e90" have entirely different histories.
4530a34175
...
12268daad6
5 changed files with 13 additions and 52 deletions
|
@ -141,10 +141,10 @@ def www_conf(metadata):
|
||||||
'listen.owner': 'www-data',
|
'listen.owner': 'www-data',
|
||||||
'listen.group': 'www-data',
|
'listen.group': 'www-data',
|
||||||
'pm': 'dynamic',
|
'pm': 'dynamic',
|
||||||
'pm.max_children': '32',
|
'pm.max_children': '30',
|
||||||
'pm.start_servers': '16',
|
'pm.start_servers': '10',
|
||||||
'pm.min_spare_servers': '8',
|
'pm.min_spare_servers': '5',
|
||||||
'pm.max_spare_servers': '16',
|
'pm.max_spare_servers': '10',
|
||||||
'pm.max_requests': '500',
|
'pm.max_requests': '500',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@ directories = {
|
||||||
'group': 'postgres',
|
'group': 'postgres',
|
||||||
'needs': [
|
'needs': [
|
||||||
'pkg_apt:postgresql',
|
'pkg_apt:postgresql',
|
||||||
f"zfs_dataset:{node.metadata.get('zfs/storage_classes/ssd')}/postgresql",
|
'zfs_dataset:tank/postgresql',
|
||||||
],
|
],
|
||||||
'needed_by': [
|
'needed_by': [
|
||||||
'svc_systemd:postgresql',
|
'svc_systemd:postgresql',
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
from importlib.metadata import metadata
|
|
||||||
|
|
||||||
|
|
||||||
root_password = repo.vault.password_for(f'{node.name} postgresql root')
|
root_password = repo.vault.password_for(f'{node.name} postgresql root')
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
|
@ -26,22 +23,13 @@ defaults = {
|
||||||
'grafana_rows': set(),
|
'grafana_rows': set(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if node.has_bundle('zfs'):
|
||||||
@metadata_reactor.provides(
|
defaults['zfs'] = {
|
||||||
'zfs/datasets',
|
'datasets': {
|
||||||
)
|
'tank/postgresql': {
|
||||||
def zfs(metadata):
|
'mountpoint': '/var/lib/postgresql',
|
||||||
if not node.has_bundle('zfs'):
|
'recordsize': '8192',
|
||||||
return {}
|
'atime': 'off',
|
||||||
|
|
||||||
return {
|
|
||||||
'zfs': {
|
|
||||||
'datasets': {
|
|
||||||
f"{metadata.get('zfs/storage_classes/ssd')}/postgresql": {
|
|
||||||
'mountpoint': '/var/lib/postgresql',
|
|
||||||
'recordsize': '8192',
|
|
||||||
'atime': 'off',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,13 +78,9 @@ defaults = {
|
||||||
'datasets': {},
|
'datasets': {},
|
||||||
'pools': {},
|
'pools': {},
|
||||||
'kernel_params': {},
|
'kernel_params': {},
|
||||||
'storage_classes': {
|
|
||||||
'ssd': 'tank',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'zfs/datasets'
|
'zfs/datasets'
|
||||||
)
|
)
|
||||||
|
@ -136,23 +132,3 @@ def headers(metadata):
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
|
||||||
'zfs/kernel_params/zfs_arc_max',
|
|
||||||
)
|
|
||||||
def arc_size(metadata):
|
|
||||||
arc_percent = metadata.get('zfs/zfs_arc_max_percent', None)
|
|
||||||
|
|
||||||
if arc_percent:
|
|
||||||
return {
|
|
||||||
'zfs': {
|
|
||||||
'kernel_params': {
|
|
||||||
'zfs_arc_max': str(int(
|
|
||||||
metadata.get('vm/ram') * 1024 * 1024 * (arc_percent/100)
|
|
||||||
)),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
return {}
|
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'vm': {
|
'vm': {
|
||||||
'cores': 16,
|
'cores': 2,
|
||||||
'ram': 32384,
|
'ram': 32384,
|
||||||
},
|
},
|
||||||
'wireguard': {
|
'wireguard': {
|
||||||
|
@ -136,9 +136,6 @@
|
||||||
},
|
},
|
||||||
'zfs': {
|
'zfs': {
|
||||||
'zfs_arc_max_percent': 75,
|
'zfs_arc_max_percent': 75,
|
||||||
'storage_classes': {
|
|
||||||
'ssd': 'ssd',
|
|
||||||
},
|
|
||||||
'pools': {
|
'pools': {
|
||||||
'tank': {
|
'tank': {
|
||||||
'type': 'mirror',
|
'type': 'mirror',
|
||||||
|
|
Loading…
Reference in a new issue