[转帖]prometheus数据采集exporter全家桶
prometheus数据采集exporter全家桶
https://blog.51cto.com/13053917/2374734
1. exporter介绍
exporter是prometheus监控中重要的组成部分,负责数据指标的采集。上篇文章介绍了prometheus server的相关内容,本文将介绍数据采集插件。官方给出的插件有node_exporter、blackbox_exporter、mysqld_exporter、snmp_exporter等,第三方的插件有redis_exporter,cadvisor等。
下面我将结合实际工作中的使用到的插件来分别介绍。
2. node_exporter
node_exporter主要用来采集机器的性能指标数据,包括cpu,内存,磁盘,io等基本信息。上边文章介绍promehteus server时已详细介绍了node_exporter,这里就不在赘述。
3. mysqld_exporter
mysqld_exporter主要用于监控采集mysql数据库服务器相关指标。
#下载二进制文件
root@db-100-51:~# cd /data/
root@db-100-51:/data# wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.10.0/mysqld_exporter-0.10.0.linux-amd64.tar.gz
root@db-100-51:/data# tar -xf mysqld_exporter-0.10.0.linux-amd64.tar.gz
root@db-100-51:/data# cd mysqld_exporter-0.10.0/
root@db-100-51:/data/mysqld_exporter-0.10.0# ls
LICENSE mysqld_exporter NOTICE
root@db-100-51:/data# mkdir log
#mysqld_exporter需要连接到数据库,创建一个登录数据库的用户
mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost' identified by Cds20180808!';
mysql> flush privileges;
#创建用于连接数据库的配置文件
root@db-100-51:/data/mysqld_exporter-0.10.0# vim .my.cnf
[client]
user=exporter
password=Cds20180808!
#创建supervisor启动mysqld_exporter
root@db-100-51:/data/mysqld_exporter-0.10.0# vim /etc/supervisor/conf.d/mysqld_exporter.conf
[program:mysqld_exporter]
command = /data/mysqld_exporter-0.10.0/mysqld_exporter -config.my-cnf="/data/mysqld_exporter-0.10.0/.my.cnf"
autostart = true
autorestart = true
startsecs = 5
startretries = 3
redirect_stderr = true
stdout_logfile=/data/mysqld_exporter-0.10.0/log/out-mysqld_exporter.log
stderr_logfile=/data/mysqld_exporter-0.10.0/log/err-mysqld_exporter.log
stdout_logfile_maxbytes = 20MB
stdout_logfile_backups = 20
#启动mysqld_exporter
root@db-100-51:/data/mysqld_exporter-0.10.0# supervisorctl update mysqld_exporter
root@db-100-51:/data/mysqld_exporter-0.10.0# supervisorctl status mysqld_exporter
4. redis_exporter
redis_exporter主要用于监控采集redis数据库服务器相关指标。
#下载二进制文件
root@redis-node1-slave:~# cd /data/ wget https://github.com/oliver006/redis_exporter/releases/download/v0.24.0/redis_exporter-v0.24.0.linux-amd64.tar.gz
root@redis-node1-slave:/data# tar -xf redis_exporter-v0.24.0.linux-amd64.tar.gz
root@redis-node1-slave:/data# mkdir /data/redis_exporter-v0.24.0
root@redis-node1-slave:/data# mv redis_exporter redis_exporter-v0.24.0
root@redis-node1-slave:/data# cd redis_exporter-v0.24.0/
root@redis-node1-slave:/data/redis_exporter-v0.24.0# mkdir log
#配置supervisor启动redis_exporter
root@redis-node1-slave:/data/redis_exporter-v0.24.0# vim /etc/supervisor/conf.d/redis_exporter.conf
[program:redis_exporter]
command = /data/redis_exporter-v0.24.0/redis_exporter -redis.addr 10.13.225.112:6379 -redis.password cds-china
autostart = true
startsecs = 5
startretries = 3
redirect_stderr = true
stout_logfile = /data/redis_exporter-v0.24.0/log/out-redis_exporter.log
stderr_logfile = /data/redis_exporter-v0.24.0/log/err-redis_exporter.log
stdout_logfile_maxbytes = 20MB
stdout_logfile_backups = 20
#启动redis_exporter
root@redis-node1-slave:/data/redis_exporter-v0.24.0# supervisorctl update redis_exporter
root@redis-node1-slave:/data/redis_exporter-v0.24.0# supervisorctl status redis_exporter
5. black_exporter
black_exporter是prometheus社区提供的官方黑盒监控解决方案,其允许用户通过:http、https、dns、tcp以及icmp的方式对网络进行探测。我们利用icmp探针可以坚持网络是否通畅,利用http,https可以坚持网页是否可以正常访问,利用tcp检测服务端口判断服务是否正常。
#下载二进制文件
root@prometheus:~# cd /data/
root@prometheus:/data# wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.13.0/blackbox_exporter-0.13.0.linux-amd64.tar.gz
root@prometheus:/data# tar -xf blackbox_exporter-0.13.0.linux-amd64.tar.gz
#修改blackbox_exporter配置文件
root@prometheus:/data# cd blackbox_exporter-0.13.0/
root@prometheus:/data/blackbox_exporter-0.13.0# vim blackbox.yml
modules:
http_2xx:
prober: http
timeout: 5s
http:
preferred_ip_protocol: "ip4"
no_follow_redirects: true
valid_http_versions: ["HTTP/1.1", "HTTP/2"]
valid_status_codes: [200,302] # Defaults to 2xx
method: GET
http_post_2xx:
prober: http
http:
method: POST
tcp_connect:
prober: tcp
timeout: 5s
pop3s_banner:
prober: tcp
tcp:
query_response:
- expect: "^+OK"
tls: true
tls_config:
insecure_skip_verify: false
ssh_banner:
prober: tcp
timeout: 5s
tcp:
query_response:
- expect: "^SSH-2.0-"
irc_banner:
prober: tcp
tcp:
query_response:
- send: "NICK prober"
- send: "USER prober prober prober :prober"
- expect: "PING :([^ ]+)"
send: "PONG ${1}"
- expect: "^:[^ ]+ 001"
icmp:
prober: icmp
timeout: 5s
#配置systemd启动blackbox_exporter
root@prometheus:/data/blackbox_exporter-0.13.0# vim /usr/lib/systemd/system/blackbox_exporter.service
[Unit]
Description=Prometheus blackbox exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target
[Service]
User=root
Type=simple
WorkingDirectory=/data/blackbox_exporter-0.13.0/
ExecStart=/data/blackbox_exporter-0.13.0/blackbox_exporter --config.file=/data/blackbox_exporter-0.13.0/blackbox.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target
root@prometheus:/data/blackbox_exporter-0.13.0# supervisorctl start blackbox_exporter
root@prometheus:/data/blackbox_exporter-0.13.0# supervisorctl enable blackbox_exporter
root@prometheus:/data/blackbox_exporter-0.13.0# supervisorctl status blackbox_exporter
6. cadvisor
cadvisor是google开源的用于监控容器运行的工具。
#下载二进制文件
root@GZH-vSPC02:~# cd /data/
root@GZH-vSPC02:/data# wget https://github.com/google/cadvisor/releases/download/v0.33.0/cadvisor
root@GZH-vSPC02:/data# mkdir cadvisor-v0.33.0
root@GZH-vSPC02:/data# mv cadvisor cadvisor-v0.33.0/
root@GZH-vSPC02:/data# cd cadvisor-v0.33.0/
root@GZH-vSPC02:/data/cadvisor-v0.33.0# mkdir log
#配置supervisor启动cadvisor
root@GZH-vSPC02:/data/cadvisor-v0.33.0# vim /etc/supervisor/conf.d/cadvisor-server.conf
[program:cadvisor-server]
command = /data/cadvisor-v0.33.0/cadvisor
autostart = true
autorestart = true
startsecs = 5
startretries = 3
redirect_stderr = true
stdout_logfile=/data/cadvisor-v0.33.0/log/out-cadvisor.log
stderr_logfile=/data/cadvisor-v0.33.0/log/err-cadvisor.log
stdout_logfile_maxbytes = 20MB
stdout_logfile_backups = 20
root@GZH-vSPC02:/data/cadvisor-v0.33.0# supervisorctl update cadvisor
root@GZH-vSPC02:/data/cadvisor-v0.33.0# supervisorctl status cadvisor
7. 配置prometheus服务端
上面布置了exporter,我们需要配置prometheus server来拿到exporter采集到数据。
#修改pormetheus配置文件,配置文件上篇文章已经介绍了,这里就不在解释
root@prometheus:~# cd /data/prometheus-2.4.3/
root@prometheus:/data/prometheus-2.4.3# vim prometheus.yml
#my global config
global:
scrape_interval: 30s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 25s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_timeout: 25s #is set to the global default (10s).
#Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- 10.13.103.152:9093
- 10.128.120.218:9093
#Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "/data/prometheus-2.4.3/rules/node_down.yml"
- "/data/prometheus-2.4.3/rules/memory_over.yml"
- "/data/prometheus-2.4.3/rules/disk_over.yml"
- "/data/prometheus-2.4.3/rules/cpu_over.yml"
- "/data/prometheus-2.4.3/rules/http_check.yml"
- "/data/prometheus-2.4.3/rules/tcp_check.yml"
- "/data/prometheus-2.4.3/rules/mysql_check.yml"
- "/data/prometheus-2.4.3/rules/redis_down_check.yml"
- "/data/prometheus-2.4.3/rules/redis_rule_check.yml"
- "/data/prometheus-2.4.3/rules/container_down.yml"
- "/data/prometheus-2.4.3/rules/ping_check.yml"
#A scrape configuration containing exactly one endpoint to scrape:
#Here it's Prometheus itself.
scrape_configs:
#The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
#metrics_path defaults to '/metrics'
#scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
- job_name: 'GICHOST'
file_sd_configs:
- files: ['./node_exporter/host.json']
- job_name: 'federate'
scrape_interval: 30s
scrape_timeout: 25s
honor_labels: true
metrics_path: '/federate'
params:
'match[]':
- '{job=~"kubernetes-.*"}'
static_configs:
- targets:
- '10.13.103.12:9090'
- job_name: 'blackbox-http'
scrape_interval: 5s
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
file_sd_configs:
- files: ['./blackbox_exporter/http.json']
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.13.103.151:9115
- job_name: 'blackbox-tcp'
scrape_interval: 5s
metrics_path: /probe
params:
module: [tcp_connect]
file_sd_configs:
- files: ['./blackbox_exporter/tcp.json']
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.13.103.151:9115
- job_name: 'mysqld-exporter'
file_sd_configs:
- files: ['./mysqld_exporter/mysqld.json']
- job_name: 'blackbox-ping'
scrape_interval: 5s
metrics_path: /probe
params:
module: [icmp]
file_sd_configs:
- files: ['./blackbox_exporter/ping.json']
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.13.103.151:9115
- job_name: 'redis-exporter'
file_sd_configs:
- files: ['./redis_exporter/redis.json']
- job_name: 'container-exporter'
file_sd_configs:
- files: ['./container_exporter/container.json']
8. 配置prometheus 主机监控文件和告警规则
8.1 主机监控文件
#mysqld_exporter主机监控文件
root@prometheus:/data/prometheus-2.4.3# mkdir mysqld_exporter
root@prometheus:/data/prometheus-2.4.3# cd mysqld_exporter/
root@prometheus:/data/prometheus-2.4.3/mysqld_exporter# vim mysqld.json
[
{
"targets":[
"10.13.100.51:9104"
],
"labels":{
"dbinstance":"db100.51"
}
}
]
#redis_exporter主机监控文件
root@prometheus:/data/prometheus-2.4.3# mkdir redis_exporter
root@prometheus:/data/prometheus-2.4.3# cd redis_exporter/
root@prometheus:/data/prometheus-2.4.3/redis_exporter# vim redis.json
[
{
"targets":[
"10.13.0.235:9121",
"10.13.0.236:9121"
],
"labels":{
"service":"redis"
}
}
]
#blackbox_exporter主机监控文件
root@prometheus:/data/prometheus-2.4.3# mkdir blackbox_exporter
root@prometheus:/data/prometheus-2.4.3# cd blackbox_exporter
root@prometheus:/data/prometheus-2.4.3/blackbox_exporter# vim http.json
[
{
"targets":[
"http://10.13.227.134:6011/health",
"http://10.13.102.134:6011/health"
],
"labels":{
"service":"WSREP"
}
}
]
root@prometheus:/data/prometheus-2.4.3/blackbox_exporter# vim tcp.json
[
{
"targets":[
"10.128.107.53:13371",
"10.128.107.57:13371"
],
"labels":{
"service":"vspc"
}
}
]
root@prometheus:/data/prometheus-2.4.3/blackbox_exporter# vim ping.json
[
{
"targets":[
"10.13.101.131",
"10.13.101.132",
"10.13.101.141"
],
"labels":{
"service":"mysql"
}
}
]
#配置cadvisor主机监控文件
root@prometheus:/data/prometheus-2.4.3# mkdir container_exporter
root@prometheus:/data/prometheus-2.4.3# cd container_exporter/
root@prometheus:/data/prometheus-2.4.3/container_exporter# vim container.json
[
{
"targets":[
"10.13.103.153:8080",
"10.128.87.5:8080"
],
"labels":{
"service":"docker-monitor"
}
}
]
8.2 告警规则
node_exporter监控获取的cpu,磁盘,实例存活规则上篇文章已经介绍,这里不再介绍
root@prometheus:/data/prometheus-2.4.3# cd rules
root@prometheus:/data/prometheus-2.4.3/rules# ls
container_down.yml disk_over.yml mysql_check.yml node_down.yml redis_down_check.yml tcp_check.yml
cpu_over.yml http_check.yml memory_over.yml ping_check.yml redis_rule_check.yml
#mysqld_exporter监控mysql数据告警规则
root@prometheus:/data/prometheus-2.4.3/rules# vim mysql_check.yml
groups:
- name: MySQLStatsAlert
rules:
- alert: MySQL is down
expr: mysql_up == 0
for: 1m
labels:
severity: critical
annotations:
summary: "Instance {{$labels.instance}} MySQL is down"
description: "MySQL database is down. This requires immediate action!(current value is: {{$value}})"
- alert: Mysql_High_QPS
expr: rate(mysql_global_status_questions[5m]) > 8000
for: 1m
labels:
severity: warning
annotations:
summary: "{{$labels.instance}}: Mysql_High_QPS detected"
description: "{{$labels.instance}}: Mysql opreation is more than 5000 per second ,(current value is: {{$value}})"
- alert: Mysql_Too_Many_Slow_Query
expr: rate(mysql_global_status_slow_queries[30m]) > 3
for: 1m
labels:
severity: warning
annotations:
summary: "{{$labels.instance}}: Mysql_Too_Many_Slow_Query detected"
description: "{{$labels.instance}}: Mysql current Slow_Query Sql is more than 3 ,(current value is: {{$value}})"
- alert: Mysql_Deadlock
expr: mysql_global_status_innodb_deadlocks > 300
for: 1m
labels:
severity: warning
annotations:
summary: "{{$labels.instance}}: Mysql_Deadlock detected"
description: "{{$labels.instance}}: Mysql Deadlock was found ,(current value is: {{$value}})"
- alert: open files high
expr: mysql_global_status_innodb_num_open_files > (mysql_global_variables_open_files_limit) * 0.75
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{$labels.instance}} open files high"
description: "Open files is high. Please consider increasing open_files_limit.(current value is: {{$value}})"
- alert: Used more than 80% of max connections limited
expr: mysql_global_status_max_used_connections > mysql_global_variables_max_connections * 0.8
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{$labels.instance}} Used more than 80% of max connections limited"
description: "Used more than 80% of max connections limited.(current value is: {{$value}})"
- alert: InnoDB Log File size is too small
expr: mysql_global_variables_innodb_log_file_size < 16777216
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{$labels.instance}} InnoDB Log File size is too small"
description: "The InnoDB Log File size is possibly too small. Choosing a small InnoDB Log File size can have significant performance impacts.(current value is: {{$value}})"
- alert: Binary Log is disabled
expr: mysql_global_variables_log_bin != 1
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{$labels.instance}} Binary Log is disabled"
description: "Binary Log is disabled. This prohibits you to do Point in Time Recovery (PiTR).(current value is: {{$value}})"
- alert: IO thread stopped
expr: mysql_slave_status_slave_io_running != 1
for: 1m
labels:
severity: critical
annotations:
summary: "Instance {{$labels.instance}} IO thread stopped"
description: "IO thread has stopped. This is usually because it cannot connect to the Master any more.(current value is: {{$value}})"
- alert: SQL thread stopped
expr: mysql_slave_status_slave_sql_running != 1
for: 1m
labels:
severity: critical
annotations:
summary: "Instance {{$labels.instance}} Sync Binlog is enabled"
description: "SQL thread has stopped. This is usually because it cannot apply a SQL statement received from the master.(current value is: {{$value}})"
- alert: Slave lagging behind Master
expr: rate(mysql_slave_status_seconds_behind_master[1m]) >30
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{$labels.instance}} Slave lagging behind Master"
description: "Slave is lagging behind Master. Please check if Slave threads are running and if there are some performance issues!(current value is: {{$value}})"
#redis_exporter监控redis指标告警规则
root@prometheus:/data/prometheus-2.4.3/rules# vim redis_down_check.yml
groups:
- name: redis检测规则
rules:
- alert: redis存活检测
expr: redis_up{job="redis-exporter"} == 0
for: 1m
annotations:
description: "机器:{{ $labels.instance }} 所属 job:{{ $labels.job }} redis宕机,请检查!"
summary: "redis服务"
root@prometheus:/data/prometheus-2.4.3/rules# vim redis_rule_check.yml
groups:
- name: RedisStatsAlert
rules:
- alert: last create rdb failed
expr: redis_rdb_last_bgsave_status != 1
for: 1m
labels:
severity: warning
annotations:
summary: " Instance {{ $labels.instance }} rdb_last_bgsave_status "
description: "last create rdb failed"
- alert: Redis linked too many clients
expr: redis_connected_clients / redis_config_maxclients * 100 > 80
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} Redis linked clients too many"
description: "Redis linked clients too many. This requires immediate action!"
- alert: master link status failed
expr: redis_master_link_up == 0
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} link failed"
description: "redis_master_link=0 link failed"
- alert: last AOF failed
expr: redis_aof_last_bgrewrite_status != 1
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} redis aof last rewrite duration sec"
description: "last AOF failed"
- alert: Redis Cluster State Wrong
expr: redis_cluster_state != 1
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} redis cluster status wrong"
description: "Redis Cluster State Wrong"
#blackbox_exporter监控指标告警规则
root@prometheus:/data/prometheus-2.4.3/rules# vim ping_check.yml
groups:
- name: 机器网络存活检测
rules:
- alert: 网络检测
expr: probe_success{job="blackbox-ping"} == 0
for: 1m
annotations:
description: "机器:{{ $labels.instance }} 所属 job:{{ $labels.job }} 网络不通或者宕机超过1分钟,请检查!"
summary: "网络检测"
root@prometheus:/data/prometheus-2.4.3/rules# vim http_check.yml
groups:
- name: 服务检测规则
rules:
- alert: http服务检测
expr: probe_success{job="blackbox-http"} == 0
for: 1m
annotations:
description: "机器:{{ $labels.instance }} 所属 job:{{ $labels.job }} http状态码: {{ printf `probe_http_status_code{instance='%s'}` $labels.instance | query | first | value }} http检测失败,请检查!"
summary: "http检测"
root@prometheus:/data/prometheus-2.4.3/rules# vim tcp_check.yml
groups:
- name: 服务检测规则
rules:
- alert: tcp服务检测
expr: probe_success{job="blackbox-tcp"} == 0
for: 1m
annotations:
description: "机器:{{ $labels.instance }} 所属 job:{{ $labels.job }} tcp检测失败,请检查!"
summary: "tcp检测"
#cadvisor监控指标告警规则
root@prometheus:/data/prometheus-2.4.3/rules# vim container_down.yml
groups:
- name: 容器存活报警规则
rules:
- alert: DockerInstanceDown
expr: absent(container_last_seen{name="core_vspc"}) == 1
for: 1m
annotations:
description: "vspc client容器:{{ $labels.name }} (所属主机{{ $labels.instance }}) 已经异常退出超过1分钟,请检查!"
summary: "容器:Instance {{ $labels.name }} 存活检测"
参考文档:
https://github.com/prometheus
https://github.com/oliver006/redis_exporter
https://github.com/google/cadvisor
[转帖]prometheus数据采集exporter全家桶的更多相关文章
- 用 Vue 全家桶二次开发 V2EX 社区
一.开发背景 为了全面的熟悉Vue+Vue-router+Vuex+axios技术栈,结合V2EX的开放API开发了这个简洁版的V2EX. 在线预览 (为了实现跨域,直接npm run dev部署的, ...
- 应用上云新模式,Aliware 全家桶亮相杭州云栖大会
全面上云带来的变化,不仅是上云企业数量上的攀升,也是企业对云的使用方式的转变,越来越多的企业用户不仅将云作为一种弹性资源,更是开始在云上部署架构和应用,借助 Serverless 等技术,开发人员只需 ...
- iOS Keychain钥匙串,应用间数据共享打造iOS上的全家桶
Demo先行:https://github.com/rayshen/GIKeychainGroupDemo 该demo里有2个工程,你先运行任何一个会存储一个值,再运行另一个会访问之前的app存储的值 ...
- vue全家桶(Vue+Vue-router+Vuex+axios)(Vue+webpack项目实战系列之二)
Vue有多优秀搭配全家桶做项目有多好之类的咱就不谈了,直奔主题. 一.Vue 系列一已经用vue-cli搭建了Vue项目,此处就不赘述了. 二.Vue-router Vue的路由,先献上文档(http ...
- 基于react全家桶+antd-design+webpack2+node+express+mongodb开发的前后台博客系统
很久没更新博客,最近也有点忙,然后业余时间搞了一个比较完整基于react全家桶+antd-design+webpack2+node+express+mongodb开发的前后台博客系统的流程系统,希望对 ...
- Vuejs实例-00Vuejs2.0全家桶结合ELementUI制作后台管理系统
Vuejs2.0全家桶结合ELementUI制作后台管理系统 0: 系统环境的介绍 1: Vuejs实例-01使用vue-cli脚手架搭建Vue.js项目 2: Vuejs实例-02Vue.js项目集 ...
- Vue全家桶
简介 “简单却不失优雅,小巧而不乏大匠”. Vue.js 是一个JavaScriptMVVM库,是一套构建用户界面的渐进式框架.它是以数据驱动和组件化的思想构建的,采用自底向上增量开发的设计. 为什么 ...
- 从零开始系列之vue全家桶(3)安装使用vuex
什么是vuex? vuex:Vue提供的状态管理工具,用于同一管理我们项目中各种数据的交互和重用,存储我们需要用到数据对象. 即data中属性同时有一个或几个组件同时使用,就是data中共用的属性. ...
- 从零开始系列之vue全家桶(1)安装前期准备nodejs+cnpm+webpack+vue-cli+vue-router
写在前面: 什么是全家桶? 包含了vue-router(http://router.vuejs.org),vuex(http://vuex.vuejs.org), vue-resource(https ...
随机推荐
- 路由器配置——OSPF协议(1)
一.实验目的:用OSPF协议使全网互通 二.拓扑图 三.具体步骤配置 (1)R1路由器配置 Router>enableRouter#configure terminalEnter configu ...
- Eclipse一直building workspace问题解决
今天新导入了一个maven项目,但是总是一直building workspace 解决方案: 去掉图中Maven Project Builder勾选
- 深度学习笔记(十三)YOLO V3 (Tensorflow)
[代码剖析] 推荐阅读! SSD 学习笔记 之前看了一遍 YOLO V3 的论文,写的挺有意思的,尴尬的是,我这鱼的记忆,看完就忘了 于是只能借助于代码,再看一遍细节了. 源码目录总览 tens ...
- 五一培训 清北学堂 DAY5
今天是吴耀轩老师的讲解- 今天的主要内容:图论 如何学好图论? 学好图论的基础:必须意识到图论! 图 邻接矩阵存图: 其缺点是显而易见的:1. 空间复杂度O(n^2)不能接受:2.有重边的时候很麻烦: ...
- Jmeter(十三)阶梯式压测
阶梯式压测,就是对系统的压力呈现阶梯性增加的过程,每个阶段压力值都要增加一个数量值,最终达到一个预期值.然后保持该压力值,持续运行一段时间. Jmeter中有个插件可以实现这个场景,这个插件就是:Co ...
- nginx静态页面镜像
user root; worker_processes ; #error_log logs/error.log; #error_log logs/error.log notice; #error_lo ...
- NSPredicate谓词的用法
在IOS开发Cocoa框架中提供了一个功能强大的类NSPredicate,下面来讨论一下它的强大之处在哪...NSPredicate继承自NSObject,它有两个派生的子类• NSCompariso ...
- Error creating bean with name 'persistenceExceptionTranslationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfiguration
dubbo 包和SpringBoot 冲突,注释就可以正常启动
- js 中null,undefined区别
首先摘自阮一峰先生的文章: 大多数计算机语言,有且仅有一个表示"无"的值,比如,C语言的NULL,Java语言的null,Python语言的None,Ruby语言的nil. 有点奇 ...
- JS高级_变量提升和函数提升
先执行变量提升,后执行函数提升 function a(){} var a console.log(typeof a)//function