支那

download:Vue core technology Vue+ VUE-Router +Vuex+SSR

This is a technical course, which will explain the core technologies of Vue in depth and detail. Through a Todo application, it will explain the Vue application development, Vue+Webpack workflow construction, Vue+ Vuex project architecture and Vue server rendering deep integration. In order to show students the various problems in Vue application development and the most suitable solutions.

支那

支那

Suitable for people and technical reserve requirements

This course is an advanced Vue course, which requires a certain Vue project foundation, and has certain requirements for your technical foundation

It is recommended that you start with the course “Vue+Webpack Building Todo Application”, so as to better learn this course

支那

支那

Technical reserve requirements:

Experience in Vue project development, ES6, Node.js, Webpack foundation

Prometheus ansible deployment + node – exporter

Simply deploy the Prometheus monitoring system

Yum device ansible

yum install ansible
Copy the code

The ansible hosts file

[alertmanagers]
10.9.119.1
[prometheus]
10.9.119.1
[node-exporter]
10.9.119.1
10.9.119.2
10.9.119.3
Copy the code

The file hierarchy format is as follows:! [] ()

prometheus

prometheus.yml

- hosts: prometheus remote_user: root tasks: - name: create dir file: path: /opt/prometheus state: Name: copy file unarchive: old-src: promethy-2.24.0.linux-amd64.tar. gz dest: promethy-2.24.0.linux-amd64.tar. gz dest: / opt/Prometheus - name: the create link file: old - SRC: / opt/Prometheus Prometheus - 2.24.0. Linux - amd64 dest: / opt/Prometheus, Prometheus state: link # soft links - name: copy the service file template: old - SRC: Prometheus. Service. J2 dest: /usr/lib/systemd/system/prometheus.service - name: copy config yaml template: old-src: prometheus.yml.j2 dest: /opt/prometheus/prometheus/prometheus.yml notify: - restart prometheus - name: create rules dir file: path: / opt/Prometheus Prometheus/rules state: directory - name: copy rules there is a special symbol yaml # node so use the copy copy: old - SRC: Node. Yml dest: / opt/Prometheus/Prometheus/rules/node. Yml notify: # this action will trigger the handlers - restart Prometheus - name: start prometheus service: name: prometheus state: started enabled: yes handlers: - name: restart prometheus service: name: prometheus state: restartedCopy the code

J2 can use the copy module, which uses template

[Unit]
Description=Prometheus
Documentation=
After=network.target
[Service]
WorkingDirectory=/opt/prometheus/prometheus
ExecStart=/opt/prometheus/prometheus/prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -KILL $MAINPID
Type=simple
KillMode=control-group
Restart=on-failure
RestartSec=3s
[Install]
WantedBy=multi-user.target
Copy the code

prometheus.yml.j2

Evaluation_interval: 30s query_log_file: /promql.log # Alarm configuration Alerting: AlertManagers: # AlertManagers configuration - static_configs: # Alertmanager Static configuration - targets: {% for alertManager in groups[' alertManagers '] %} - {{alertManager}}:9093 {% endfor %} Rule_files: # file configuration rules - "rules / *. Yml" scrape_configs: # fetching configuration - job_name: 'Prometheus' # static_configs classification task collection aim: Targets: static configuration {% for prometheu in groups['prometheu '] %} - "{{prometheu}}:9090" "node" static_configs: - targets: {% for node in groups['node-exporter'] %} - "{{ node }}:9100" {% endfor %}Copy the code

Node-rules Rules file node.yml

Rules: - alert: node is Down expr: up == 0 for: Label: Severity: Serious # "Instance {{$labels. Instance}} down" "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes." node Filesystem expr: 100 - (node_filesystem_free_bytes{fstype=~"ext4|xfs"} / node_filesystem_size_bytes{fstype=~"ext4|xfs"} * 100) > 80 for: Annotations: "{{$alllabels. Instance}}: {{$alllabels. Mountpoint}} "description: "{{$attractions. instance}}: {{$attractions. mountpoint}} "- alert: node Memory expr: 100 - (node_memory_MemFree_bytes+node_memory_Cached_bytes+node_memory_Buffers_bytes) / node_memory_MemTotal_bytes * 100 > 80 for: 2m labels: severity: warning annotations: summary: "{{$alllabels. Instance}}: Excessive memory usage "description: "{{$value. instance}}: memory expr > 80% (current value: {{$value}})" - alert: node CPU expr: 100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) by (instance) * 100) > 80 for: 2m labels: severity: Warning Annotations: Summary: "{{$alllabels. Instance}}: CPU usage is too high "description: "{{$alllabels. {{ $value }})"Copy the code

node-exporter

node-exporter.yml

- hosts: node-exporter remote_user: root tasks: - name: create dir file: path: /opt/prometheus state: directory - name: Copy file unarchive: old-src: node_classifie-1.0.1.linux-amd64.tar. gz dest: /opt/ prometh-name: create link file: Linux - AMd64 dest: /opt/ Prometheus/node_exporters: link-name: copy service file template: old-src: node_exporter.service.j2 dest: /usr/lib/systemd/system/node_exporter.service - name: start node_exporter service: name: node_exporter state: restarted enabled: yesCopy the code

node_exporter.service.j2

[Unit] Description=Node Exporter Documentation= After=network.target [Service] WorkingDirectory=/opt/prometheus/node_exporter/ ExecStart=/opt/prometheus/node_exporter/node_exporter ExecStop=/bin/kill  -KILL $MAINPID Type=simple KillMode=control-group Restart=on-failure RestartSec=3s [Install] WantedBy=multi-user.targetCopy the code

alertmanager

alertmanager.yaml

- hosts: alertmanagers remote_user: root tasks: - name: create dir file: path: /opt/prometheus state: directory - name: Copy file unarchive: old-src: alertManager-0.21.0.linux-amd64.tar. gz dest: /opt/ promethy-name: create link file: Old - SRC: / opt/Prometheus alertmanager - 0.21.0. Linux - amd64 dest: / opt/Prometheus alertmanager state: the link - name: copy service file template: old-src: alertmanager.service.j2 dest: /usr/lib/systemd/system/alertmanager.service - name: copy config yaml template: old-src: alertmanager.yml.j2 dest: /opt/prometheus/alertmanager/alertmanager.yml notify: - restart alertmanager - name: start server service: name: alertmanager state: restarted enabled: yes handlers: - name: restart alertmanager service: name: alertmanager state: restartedCopy the code

alertmanager.service.j2

[Unit]
Description=AlertManager
Documentation=
After=network.target
[Service]
WorkingDirectory=/opt/prometheus/alertmanager/
ExecStart=/opt/prometheus/alertmanager/alertmanager
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -KILL $MAINPID
Type=simple
KillMode=control-group
Restart=on-failure
RestartSec=3s
[Install]
WantedBy=multi-user.target
Copy the code

Alertmanager.yml. J2 Uses email alerts

Global: resolve_timeout: 5m # How long does it take for the alarm to be cleared after firing is changed to resolve? smtp_from: "[email protected]" smtp_smarthost: 'smtp.qq.com:465' smtp_auth_username: "[email protected]" # email account smtp_auth_password: "bcvizcgqbgojjjeb" # password password, not QQ password smtp_require_TLS: Group_by: ['alertname'] group_wait: 10s 10S # Time between the upper and lower groups for sending alarms 10s REPEAT_interval: 24h # Time for repeatedly sending alarms. Silent receiver: 'default-receiver' # Acquiesce receiver # All alarms that do not match the following sub-routes are saved on the root node and sent to 'default-receiver' routes: # receiver: 'db' group_wait: 10s match_re: All mysql | # redis service = mysql or service = redis alarm assigned to db acceptance side - receiver: 'web' group_by: [Product, environment] [Match: team: frontend] - name: 'default-receiver' email_configs: to: '[email protected]' # Alarm recipient - name: 'db' # Email_configs: to: '[email protected]' - name: 'web' email_configs: - to: '[email protected]' inhibit_rules: - source_match: severity: indicates the severity of the alarm. Target_match: severity: 'warning' equal: ['alertname', 'dev', 'instance']Copy the code

支那