diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index dda0128a5..134364b30 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -9,23 +9,19 @@ on: branches: [main, master] # 定时执行,字段含义:分钟 小时 日 月 星期 # 注意: - # 1.如果没有在下方配置时区,那默认采用的是 UTC 时间 + # 1.采用的是 UTC 时间 # 即,你配置的 0 0 * * *(UTC)00:00 实际上是(GMT+0800)08:00 # 只有你配置为 00 16 * * *(UTC)16:00 实际上才是 GMT+0800)00:00 # 2.官方声明:schedule 事件在 GitHub Actions 工作流运行期间负载过高时可能会延迟。 高负载时间包括每小时的开始时间。 为了降低延迟的可能性,建议将您的工作流程安排在不同时间运行。 - # 例如:笔者之前没设置时区前设定的定时规则为 0 0 * * *,实际(GMT+0800)执行时间通常在 9:10 ~ 10:00,甚至会出现在 10:00 之后执行的情况 + # 例如:笔者之前设定的定时规则为 0 0 * * *(UTC),实际(GMT+0800)执行时间通常在 9:10 ~ 10:00,甚至会出现在 10:00 之后执行的情况 # 3.建议不只是定时执行的时候注意时间,自己 push 时也注意时间,早点休息 # 例如:笔者多次亲身经历,凌晨时间 pages build and deployment 任务大概能持续 8 分钟的 Current status: deployment_queued 状态, # 即使能进入 Current status: deployment_in_progress 和 Current status: syncing_files 状态,如果文件多点,没一会儿就 Error: Timeout reached, aborting! 超时失败了 schedule: - - cron: 30 1 * * * + - cron: 30 17 * * * # 可手动执行 workflow_dispatch: -# 设置时区(默认是 UTC 时间) -env: - TZ: Asia/Shanghai - jobs: # 任务1: 部署 GitHub Pages deploy-github-pages: diff --git a/docs/categories/fragments/2022/10/06/个人常用快捷键.md b/docs/categories/fragments/2022/10/06/个人常用快捷键.md index c64074b98..db704713a 100644 --- a/docs/categories/fragments/2022/10/06/个人常用快捷键.md +++ b/docs/categories/fragments/2022/10/06/个人常用快捷键.md @@ -102,4 +102,8 @@ tags: - 在创建对象时,先写完后面 new Xxx() 部分,然后输入 .var + 回车:补全前面声明部分 - 数组/Collection系列集合,.for + 回车:生成增强 for 语句 - 数组/Collection系列集合,.fori + 回车:生成循环下标语句(Set集合不行) -- 返回值,.return + 回车:生成 return 返回值; 语句 \ No newline at end of file +- 返回值,.return + 回车:生成 return 返回值; 语句 + +## 浏览器 + +- Ctrl + 0:恢复页面默认缩放 \ No newline at end of file diff --git a/docs/categories/fragments/2022/10/25/Docker安装Consul.md b/docs/categories/fragments/2022/10/25/Docker安装Consul.md new file mode 100644 index 000000000..1472a68a3 --- /dev/null +++ b/docs/categories/fragments/2022/10/25/Docker安装Consul.md @@ -0,0 +1,60 @@ +--- +title: Docker安装Consul +author: 查尔斯 +date: 2022/10/25 22:00 +categories: + - 杂碎逆袭史 +tags: + - Consul + - Docker + - 容器 +showComment: false +--- + +# Docker安装Consul + +## 拉取镜像 + +::: warning 笔者说 +拉取镜像时需要明确镜像版本(Tag)。 +::: + +不指定版本(Tag)就拉取镜像,那拉取下来的镜像版本(Tag)默认是 `latest`(最新的)。`latest` 会跟随 Docker Registry 中的记录变化,现在拉取下来的 `latest` 是 x1 版本,但隔了一段时间后你在其他机器上再拉取 `latest` 可能就是 x2 版本了。 + +笔者下面的步骤及配置也是基于指定版本的实践,大多数程序大多数情况下在相差不大的版本时可以直接参考。(当然了,即使是非 Docker 方式安装程序也是一样道理) + +变化的版本,不利于生产环境部署的稳定。无论是后续在其他环境部署还是扩容集群等场景均要求根据架构要求指定好版本。 + +```shell +docker pull consul:1.13.3 +``` + +## 运行容器 + +::: warning 笔者说 +**下方的配置,切记要根据个人实际情况来修改。** +::: + +- 是否端口映射? +- 映射的话映射到宿主机哪个端口? +- 是否挂载卷? +- 挂载的话要挂载宿主机哪个目录? +- 是否设置自启动? +- 容器的名称 +- 镜像名称:版本 +- ...... +- 等自定义配置 + +```shell +docker run -d \ +-p 18500:8500 \ +-v /opt/disk/consul/conf/:/consul/conf/ \ +-v /opt/disk/consul/data/:/consul/data/ \ +--restart=always \ +--name consul \ +consul:1.13.3 +``` + +## 验证 + +服务器开放好相应端口或设置好安全组后,访问 `http://宿主机IP:映射的端口` (例如按上方配置那就是:http://宿主机IP:18500)即可看到 Consul 界面。