metrics

k8s 基础概念

旧城冷巷雨未停 提交于 2019-11-28 13:00:30
摘录自k8s中文社区https://www.kubernetes.org.cn/course kubernetes 源自希腊文,意为舵手,k与s之间是8个字母,所以也叫k8s, docker就像一个个的集装箱,容器本身仅提供了托管运行应用的底层逻辑,而容器编排 Orchestration才是真正产生价值所在, 而k8s就是负责运送doker的舵手,负责容器编排 容器编排是指容器应用的自动布局,协同,管理, 主要负责以下任务 Service Discovery Load Balancing Secrets/configuration/storage management Health checks Auto-[scaling/restart/healing] of containers and nodes Zero-downtime deploys 谷歌在容器编排领域已经浸淫十几年,在这期间出现过Docker Swarm, Mesos, 都被比下去了 K8S是容器编排领域的领导者 流程图 功能 基于容器的应用部署、维护和滚动升级 负载均衡和服务发现 跨机器和跨地区的集群调度 自动伸缩 无状态服务和有状态服务 广泛的Volume支持 插件机制保证扩展性 1、pod 一组紧密关联的容器集合,支持多个容器在一个pod中共享网络和文件系统,克通过进程间的通信和共享文件完成任务

springcloud hystrix 部分参数整理

我与影子孤独终老i 提交于 2019-11-28 11:07:32
hystrix.command.default和hystrix.threadpool.default中的default为默认CommandKey Command Properties Execution相关的属性的配置: hystrix.command.default.execution.isolation.strategy 隔离策略,默认是Thread, 可选Thread|Semaphore hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds 命令执行超时时间,默认1000ms hystrix.command.default.execution.timeout.enabled 执行是否启用超时,默认启用true hystrix.command.default.execution.isolation.thread.interruptOnTimeout 发生超时是是否中断,默认true hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests 最大并发请求数,默认10,该参数当使用ExecutionIsolationStrategy.SEMAPHORE策略时才有效。如果达到最大并发请求数

Accuracy metric of a subsection of categories in Keras

北城余情 提交于 2019-11-28 10:51:11
问题 I've got a 3-class classification problem. Let's define them as classes 0,1 and 2. In my case, class 0 is not important - that is, whatever gets classified as class 0 is irrelevant. What's relevant, however, is accuracy, precision, recall, and error rate only for classes 1 and 2. I would like to define an accuracy metric that only looks at a subsection of the data that relates to 1 and 2 and gives me a measure of that as the model is training. I am not asking for code for accuracy or f1 or

Calculate distance between colors in HSV space

人走茶凉 提交于 2019-11-28 08:41:21
I intend to find a distance metric between two colours in HSV space. Suppose that each colour element has 3 components: hue, saturation, and value. Hue is ranged between 0 to 360, saturation is ranged between 0 to 1, and value is ranged between 0 to 255. Also hue has a circular property, for example, 359 in hue is closer to 0 in hue value than 10 in hue. Can anyone provide a good metric to calculate the distance between 2 colour element in HSV space here? First a short warning: Computing the distance of colors does not make sense (in most cases). Without considering the results of 50 years of

Prometheus监控篇

℡╲_俬逩灬. 提交于 2019-11-28 07:52:26
一、Prometheus介绍 之前已经详细介绍了Kubernetes集群部署篇,今天这里重点说下Kubernetes监控方案-Prometheus+Grafana。Prometheus(普罗米修斯)是一个开源系统监控和警报工具,最初是在SoundCloud建立的。自2012年成立以来,许多公司和组织都采用了普罗米修斯,该项目拥有一个非常活跃的开发者和用户社区。它现在是一个独立的开放源码项目,并且独立于任何公司,为了强调该点并澄清项目的治理结构,Prometheus在2016年加入了云计算基金会,成为继Kubernetes之后的第二个托管项目。 Prometheus是用来收集数据的,同时本身也提供强大的查询能力,结合Grafana即可以监控并展示出想要的数据。 Prometheus的主要特征 - 多维度数据模型 - 灵活的查询语言 (PromQL) - 不依赖分布式存储,单个服务器节点是自主的 - 以HTTP方式,通过pull模型拉去时间序列数据 - 也通过中间网关支持push模型 - 通过服务发现或者静态配置,来发现目标服务对象 - 支持多种多样的图表和界面展示,grafana也支持它 Prometheus组件 Prometheus生态包括了很多组件,它们中的一些是可选的: - 主服务Prometheus Server负责抓取和存储时间序列数据 - 客户库负责检测应用程序代码 -

Helm 安装部署Kubernetes的dashboard

筅森魡賤 提交于 2019-11-28 07:31:36
本来没打算搞这个文章的,第一里面有瑕疵(没搞定的地方),第二在我的 Ubuntu 18 Kubernetes集群的安装和部署 以及Helm的安装 也有安装,第三 和社区的问文章比较雷同 https://www.kubernetes.org.cn/5551.html kubeadm是Kubernetes官方提供的用于快速安装Kubernetes集群的工具,伴随Kubernetes每个版本的发布都会同步更新,kubeadm会对集群配置方面的一些实践做调整,通过实验kubeadm可以学习到Kubernetes官方在集群配置上一些新的最佳实践。 最近发布的 Kubernetes 1.15 .2中, kubeadm 对HA集群的配置已经达到beta可用,说明kubeadm距离生产环境中可用的距离越来越近了。 1.准备 1.1系统配置 在安装之前,需要先做如下准备。两台Centos 18如下: 192.168.100.11 k8s-master 192.168.100.12 k8s-node 禁用防火墙: systemctl stop firewalld systemctl disable firewalld 禁用SELINUX: setenforce 0 vi /etc/selinux/config SELINUX=disabled 创建vi /etc/sysctl.d/k8s.conf文件

[elk]elk的诸多beats&&kibana插件

∥☆過路亽.° 提交于 2019-11-28 06:16:43
elk的诸多beats 参考: https://www.elastic.co/guide/en/beats/libbeat/current/community-beats.html jmxproxybeat 参考: https://github.com/radoondas/jmxproxybeat Metricbeat 正确姿势启动metricbeat metricbeat.modules: - module: system metricsets: - cpu - filesystem - memory - network - process enabled: true period: 10s processes: ['.*'] cpu_ticks: false output.elasticsearch: hosts: ["http://192.168.x.x:9200"] setup.template.name: "metricbeat" setup.template.fields: "fields.yml" setup.template.overwrite: true setup.template.settings: index.number_of_shards: 1 index.number_of_replicas: 1 setup.kibana.host: "192.168

When, if ever, is “number of lines of code” a useful metric?

帅比萌擦擦* 提交于 2019-11-28 06:09:43
Some people claim that code's worst enemy is its size, and I tend to agree. Yet every day you keep hearing things like I write blah lines of code in a day. I own x lines of code. Windows is x million lines of code. Question: When is "#lines of code" useful? ps: Note that when such statements are made, the tone is "more is better". I'd say it's when you're removing code to make the project run better. Saying you removed "X number of lines" is impressive. And far more helpful than you added lines of code. I'm surprised nobody has mentioned Dijkstra's famous quote yet, so here goes: My point

聚类

安稳与你 提交于 2019-11-28 05:32:26
kmeans是一种无监督的聚类问题,在使用前一般要进行数据标准化, 一般都是使用欧式距离来进行区分,主要是通过迭代质心的位置 来进行分类,直到数据点不发生类别变化就停止, 一次分类别,一次变换质心,就这样不断的迭代下去 优势:使用方便 劣势:1.K值难确定 2. 复杂度与样本数量呈线性关系 3.很难发现形状任意的簇 4.容易受初始点的影响 python中使用 sklearn.cluster 模块,使用的时候需要指定参数 第一步:导入数据,提取数据中的变量保存为X import pandas as pd beer = pd.read_csv('data.txt', sep=' ') X = beer[["calories","sodium","alcohol","cost"]] 第二步:进行kmans聚类分析 from sklearn.cluster import KMeans km = KMeans(n_clusters=3).fit(X) #聚成三蔟 km2 = KMeans(n_clusters=2).fit(X) #聚成两蔟 beer['cluster'] = km.labels_ #返回聚类的标签结果 beer['cluster2'] = km2.labels_ beer.sort_values('cluster') #根据'cluster'进行排序 第三步

ganglia监控hadoop集群配置

血红的双手。 提交于 2019-11-28 04:30:54
ganglia简介 实验环境 ganglia安装配置 安装 配置 Hadoop配置 成果 注意问题 参考 本篇文章是参考网上别人的博客,加自己实践后记录下来的,免得自己又忘了,感谢互联网的分享精神,感谢大牛们的分享。 ganglia简介 名词说明 引用自此博客介绍 Metrics- 监控电脑的运行数据 Node - 一台电脑,或许拥有多个CPU,中文称之为节点。 Cluster - 一组节点,中文称之为簇。通常节点之间拥有达到G比特的高带宽,簇内通过组播协议,每个节点组播自己的数据,所以每个节点拥有整个簇的状态,这种冗余设计可以提高簇的鲁棒性。一般簇内节点为相同的系统和体系结构,由同一个管理员管理。 Grid - 一组簇,中文可称之为网格。网格的用处是在一个大范围内把各异构的簇通过宽带汇聚在一起。 Ganglia的各种组成 功能 名称及配置文件 位置 数据采集器 名叫gmond(Ganglia MONitor Daemon)的服务程序,配置文件是/etc/ganglia/gmond.conf 位于每个Node上 数据混合收集器 名叫gmetad(Ganglia METAdata Daemon)的服务程序,配置文件是/etc/ganglia/gmetad.conf。它通过轮询收集gmond的数据,并聚合簇的各类信息,然后保存在本地rrdtool的数据库中