2020年4月23日 gitlab 使用青云 qingstor 对象存储作为存储 使用 s3 compatible 模式, 腾讯云、阿里云、华为云、青云 都可以实现。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # https://docs.gitlab.com/ce/administration/job_artifacts.html gitlab_rails['artifacts_enabled'] = true gitlab_rails['artifacts_object_store_enabled'] = true gitlab_rails['artifacts_object_store_remote_directory'] = "gitlab-storage-artifacts" gitlab_rails['artifacts_object_store_connection'] = { # s3v4 compatible mode # https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/objectstorage/rails.minio.yaml 'provider' => 'AWS', 'region' => 'us-east-1', 'aws_access_key_id' => 'ACID_XXXXXXXXXXXXXXXXX', 'aws_secret_access_key' => 'ACKEY_YYYYYYYYYYYYYYYY', 'aws_signature_version' => 4, 'host' => 's3.pek3b.qingstor.com', 'endpoint' => "http://s3.pek3b.qingstor.com", 'path_style' => true }……
阅读全文
2020年4月23日 TiDB 2.1 备份恢复与迁移 备份 https://pingcap.com/docs-cn/v2.1/how-to/maintain/backup-and-restore/ 使用 mydumper 备份 mydumper: https://github.com/maxbube/mydumper/releases 1 mydumper -h 127.0.0.1 -P 4000 -u root -t 32 -F 64 -B test -T t1,t2 --skip-tz-utc -o ./var/test 我们使用 -B test 表明是对 test 这个 database 操作,然后用 -T t1,t2 表明只导出 t1,t2 两张表。 -t 32 表明使用 32 个线程去导出数据。-F 64 是将实际的 table 切分成多大的 chunk,这里就是 64MB 一个 chunk。 --skip-tz-utc 添加这个参数忽略掉 TiDB 与导数据的……
阅读全文
2020年4月4日 linux 创建本地源 ubuntu 创建 local repo 将包放在 debs 目录下, 使用如下命令创建 私有仓库索引 1 2 3 cd /data/repo dpkg-scanpackages debs/ /dev/null |gzip > debs/Packages.gz centos 创建 local repo 将包放在 /data/repo/centos7 目录下, 使用如下命令创建 私有仓库索引 1 2 3 cd /data/repo/centos7 createrepo .……
阅读全文
2020年1月16日 使用 lego 申请 let’s encrypt 证书 lego 是用来申请 let's encrypt 免费证书的, 现在支持多种验证方式。 以下是使用 alidns 解析验证。 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/bin/bash # # lego-letsencrypt.sh # cd $(dirname $0) which lego || { lego_ver=v3.7.0 wget -c https://github.com/go-acme/lego/releases/download/${lego_ver}/lego_${lego_ver}_linux_amd64.tar.gz -o lego.tar.gz tar xf lego.tar.gz cp -a lego /usr/local/bin/lego } DomainList="*.example.com,*.example.org" EMAIL="
[email protected] " export ALICLOUD_ACCESS_KEY=LTAxxxxxx export ALICLOUD_SECRET_KEY=yyyyyyyyyyyyyyyyy Domains="" for domain in ${DOMAINs//,/ } do { Domains="${Domains} --domain=${domain}" }……
阅读全文
2019年12月10日 calico 配置 BGP Route Reflectors Calico作为k8s的一个流行网络插件,它依赖BGP路由协议实现集群节点上的POD路由互通;而路由互通的前提是节点间建立 BGP Peer 连接。BGP 路由反射器(Route Reflectors,简称 RR)可以简化集群BGP Peer的连接方式,它是解决BGP扩展性问题的有效方式;具……
阅读全文
2019年11月26日 calico 简单笔记 calico 是一种基础 vRouter 的3层网络模型 (BGP 网络)。 在应用到 k8s 中,可以提到常见的 flannel。 使用节点主机作为 vRouter 实现 3层转发。 提高网络性能。 calico 的网络模型 calico 可以通过设置 IP-in-IP 控制网络模型: https://docs.projectcalico.org/v3.5/usage/configuration/ip-in-ip ipipMode=Never: BGP 模型。 完全不使用 IP-in-IP 隧道, 这就是常用的 BGP 模型。 ipipMode=Always: calico 节点直接通过 IP 隧道的的方式实现节点互通。 这实际……
阅读全文
2019年8月10日 ingress 配置 for-forward-for The client IP address will be set based on the use of PROXY protocol or from the X-Forwarded-For header value when use-forwarded-headers is enabled. https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-forwarded-headers https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#forwarded-for-header 1 2 3 4 5 6 7 8 apiVersion: extensions/v1beta1 kind: Ingress metadata: name: srv-bff-op-center annotations: nginx.ingress.kubernetes.io/forwarded-for-header: "X-Forwarded-For" kubernetes.io/ingress.class: "nginx"……
阅读全文
2019年4月24日 docker daemon.json 配置文件 daemon.json 配置方式 Linux: /etc/docker/daemon.json Windows Server: C:\ProgramData\docker\config\daemon.json Docker for Mac / Docker for Windows: Click the Docker icon in the toolbar, select Preferences, then select Daemon. Click Advanced. daemon.json 配置 镜像加速器 1 2 3 4 5 6 7 8 9 // 配置一个 { "registry-mirrors": ["https://registry.docker-cn.com"] } // 配置多个 { "registry-mirrors": ["https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn"] } 镜像加速器常用值: docker-cn 官方 : https://registry.docker-cn.com 中科大 : https://docker.mirrors.ustc.edu.cn 日志 1 2 3 4 { "debug": true, "log-level": "info" } log-level 的有效值包括: debug, info, warn, error, fatal 监控 Prometheus https://docs.docker.com/engine/admin/prometheus/#configure-docker 1 2 3 4 { "metrics-addr" : "127.0.0.1:9323", "experimental" : true } 保持容器在线 https://docs.docker.com/engine/admin/live-restore/#enable-the-live-restore-option 当……
阅读全文
2019年4月23日 关于 uri 的截取 location 中的 root 和 alias root 指令只是将搜索的根设置为 root 设定的目录,即不会截断 uri,而是使用原始 uri 跳转该目录下查找文件 alias 指令则会截断匹配的 uri,然后使用 alias 设定的路径加上剩余的 uri 作为子路径进行查找 示例 1: root #------------目录结构---------- /www/x1/index.html /www/x2/index.html #--------……
阅读全文
2019年4月19日 TCP keepalive 探活机制 Content here 参考资料 tcp keepalive howto tcp 协议 syn 攻击 为什么基于TCP的应用需要心跳包……
阅读全文