2023年8月22日 使用 STS 登陆 Aliyun 命令行 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/22/aliyun-sso-login-and-configure/ 使用 acs-sso 登陆, 获取 sts token 1 $ acs-sso login --profile my-profile 配置 aliyun configure, aliyun cli 非交互式登陆 1 2 3 4 5 6 7 $ aliyun configure set \ --profile my-profile \ --mode StsToken \ --region cn-hangzhou \ --access-key-id AccessKeyId \ --access-key-secret AccessKeySecret \ --sts-token StsToken 使用 aliyun --profile my-profile XXXX 执行命令 2. 使用 jq 提取字段, 完成自动登陆 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #!/bin/bash……
阅读全文
2023年8月14日 Golang 接入 OpenTelemetry 完整过程和思路(附源码) - Gin Demo 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/14/golang-opentelemetry-notes/ 为了更方便的查看代码, 建议直接跳转到 Github 仓库: https://github.com/tangx/opentelemetry-gin-demo 使用笔记 1. 使用 Otel-Collect-Contrib 初始化 trace.Provider 这里使用 app -> collector-contrib 进行转发, 应用不直接对后端的存储。 适配性 更高。 collector-contrib 最常见的两种协议 grpc / http(s)。 传入 endpoint 地址进行初始化 Provid……
阅读全文
2023年8月5日 kubernetes集群中夺命的5秒DNS延迟 如果在 公众号 文章发现状态为 已更新, 建议点击 查看原文 查看最新内容。 状态: 未更新 原文链接: https://typonotes.com/posts/2023/08/05/k8s-dns-5s-resolv/ kubernetes集群中夺命的5秒DNS延迟 问题原因 相关文章 kubernetes集群中夺命的5秒DNS延迟 破案:Kubernetes/Docke……
阅读全文
2023年7月14日 Aliyun Rds Pgsql Permission Best Practise 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/14/aliyun-rds-pgsql-permission-best-practise/ 注意: 在 PgSQL 中, 用户是基于 实例 的, 权限是基于 数据表/数据库 的。 换句话说, 创建的用户是可以看见所有数据库和数据表的, 但是看不到其具体内容。 创建只读用户 0. 登陆/切换 目标数据库 直接登陆目标数据库 1 2 ## login psql -u root -d dbname ; 或者登陆后切换到目标……
阅读全文
2023年7月13日 Pgsql Stop Spliting Values in Mulitple Lines 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/13/pgsql-stop-spliting-values-in-mulitple-lines/ psql doesn’t split your string in multiple lines. It’s the string that contains new-line characters (ASCII 10), and psql displays them accurately. The + at the end of every line is psql’s way of telling you that the value is continued in the next line. You can use the unaligned mode (psql option -A) to get rid of the +, but the output format is less attractive then. You can get rid of the newlines in a string with 1 2 3 4 5 SELECT translate(..., E'\n', ''); # or SELECT REPLACE(..., E'\n', ''); decode will be able to handle such a string.……
阅读全文
2023年7月13日 Shell: 将环境变量作为具名参数使用 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/13/shell-using-env-var-as-named-arg/ 1. 位置参数 在 Shell 中, 最常用的参数就是 位置参数。 1 2 3 4 #!/bin/bash echo '$1 =' $1 echo '$2 =' $2 echo '$11 =' ${11} 执行结果如下 1 2 3 4 $ bash pos-var.sh 1 2 3 4 5 6 7 8 9 10 abc111 $1 = 1 $2 = 2 $11 = abc111 位置参数 使用数字表示对应的参数的位置, 不具有明确的 语义。 修改输入参……
阅读全文
2023年7月11日 Docker 制作容器镜像实践: Nginx+Php 二合一 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/11/docker-image-all-in-one-policy/ Docker 制作容器镜像的时候, 一定不能 All In One 吗? All in One 指的是把所有依赖都制作到同一个镜像中, 比如 app, mysql, redis。 一般来说 不要, 尽量保证一个镜像一个 应用。 解耦合。 可以这么理解 容器重启相当于机器重启 , 也就是 容器内的服务全部……
阅读全文
2023年6月29日 Grafana(6): 使用数据源实现扩展函数支持 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/06/29/grafana-function-extends-support/ Grafana 只提供了 Grafana 变量内置语法 。 例如 1 2 3 servers = ['test1.', 'test2'] String to interpolate: '${servers:regex}' Interpolation result: '(test1\.|test2)' 但并没有提供额外的 function/函数 功能。 这也直接导致了在界面配置的时候, 可能无法与很多第三方组件进行交互。 举个例子 举个例子, 我使用了 Aliyun SLS 服务作为日……
阅读全文
2023年6月27日 《容器云平台排错一览图》 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/06/27/cloudnative-k8s-debug-flow/ 这张 《容器云平台排错一览图》 不仅 逻辑清晰的为我们提供了 排错思路、流程 和 check list。 而且 通过不同颜色, 非常贴心的为我们提供常用建议。 黑色: 命令 绿色: 直接修复方案 蓝色: 建议 感谢作者。 图片来源: learnk8s.io 绘制/勘误: Spark 点击下载 高……
阅读全文
2023年6月17日 Grafana: (5) Data Source 绑定/联动的解决方案(曲线救国) 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/06/17/grafana-datasource-relation/ 之前在下述两篇文章中说到了 Grafana 变量的应用 Grafana: (1) DataSource 数据源管理 Grafana: (3) 变量的创建、管理与使用 我们将数据源的值使用了 变量 控制, 保证同样的 Dashboard 可以应用到不同的环境。 不仅减少工作了工作, 还同时保证了环境的一致性。 但是,……
阅读全文