From 3e4ca780c5dbeac5d826cfcb2a24ef4b98b1da91 Mon Sep 17 00:00:00 2001 From: Mykola Marzhan Date: Wed, 28 Dec 2016 17:47:29 +0200 Subject: [PATCH] add CentOS 7 rpms support --- nginx.conf | 52 +++++++++++++--------------------------- sysconfig/consul | 1 + sysconfig/grafana-server | 1 + sysconfig/node_exporter | 2 ++ sysconfig/prometheus | 1 + 5 files changed, 21 insertions(+), 36 deletions(-) create mode 100644 sysconfig/consul create mode 100644 sysconfig/grafana-server create mode 100644 sysconfig/node_exporter create mode 100644 sysconfig/prometheus diff --git a/nginx.conf b/nginx.conf index 803f8b23d..7b071d5e8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,39 +1,21 @@ -user www-data; -worker_processes 4; -pid /run/nginx.pid; -daemon off; - -events { - worker_connections 768; -} - -http { - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - include /etc/nginx/mime.types; - default_type application/octet-stream; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; gzip on; map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { - listen *:80; + listen 80; + listen 443 ssl; server_name _; server_tokens off; - root /opt/landing-page; + root /usr/share/pmm-server/landing-page; ## BEGIN Those lines are managed from entrypoint.sh #include nginx-ssl.conf; - auth_basic off; - auth_basic_user_file .htpasswd; + auth_basic off; + auth_basic_user_file .htpasswd; ## END - + # Grafana rewrite ^/graph$ /graph/; location /graph { @@ -46,21 +28,21 @@ http { proxy_pass http://127.0.0.1:9090; } - # Consul UI + # Consul UI location /consul/ { - proxy_pass http://127.0.0.1:8500/ui/; - } + proxy_pass http://127.0.0.1:8500/ui/; + } # Consul API - location /v1/ { + location /v1/ { proxy_pass http://127.0.0.1:8500/v1/; add_header X-Remote-IP $remote_addr; add_header X-Server-Time $date_gmt; - } + } # QAN App location /qan { - alias /opt/qan-app; + alias /usr/share/percona-qan-app; } # QAN API @@ -69,16 +51,14 @@ http { proxy_pass http://127.0.0.1:9001; rewrite ^/qan-api/(.*) /$1 break; proxy_set_header Host $http_host; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; proxy_read_timeout 86400; } - # Orchestrator + # Orchestrator location /orchestrator { proxy_pass http://127.0.0.1:4000; } } -} - diff --git a/sysconfig/consul b/sysconfig/consul new file mode 100644 index 000000000..3423d0863 --- /dev/null +++ b/sysconfig/consul @@ -0,0 +1 @@ +OPTIONS="-server -bootstrap -client=0.0.0.0 -advertise=127.0.0.1 -ui" diff --git a/sysconfig/grafana-server b/sysconfig/grafana-server new file mode 100644 index 000000000..c4ffea0d2 --- /dev/null +++ b/sysconfig/grafana-server @@ -0,0 +1 @@ +OPTIONS="cfg:default.server.root_url=%(protocol)s://%(domain)s:%(http_port)s/graph" diff --git a/sysconfig/node_exporter b/sysconfig/node_exporter new file mode 100644 index 000000000..58947a09c --- /dev/null +++ b/sysconfig/node_exporter @@ -0,0 +1,2 @@ +WEB_LISTEN_ADDRESS="localhost:9100" +COLLECTORS_ENABLED="diskstats,filefd,filesystem,loadavg,meminfo,netdev,netstat,stat,time,uname,vmstat" diff --git a/sysconfig/prometheus b/sysconfig/prometheus new file mode 100644 index 000000000..35204a9e6 --- /dev/null +++ b/sysconfig/prometheus @@ -0,0 +1 @@ +OPTIONS="-storage.local.retention=720h -storage.local.memory-chunks=262144 -storage.local.chunk-encoding-version=2 -web.external-url=http://localhost:9090/prometheus/"