<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>运维 on Guixian 的日常记录</title><link>https://blog.chenguixian.com/categories/%E8%BF%90%E7%BB%B4/</link><description>Recent content in 运维 on Guixian 的日常记录</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 20 Dec 2025 21:31:26 +0800</lastBuildDate><atom:link href="https://blog.chenguixian.com/categories/%E8%BF%90%E7%BB%B4/index.xml" rel="self" type="application/rss+xml"/><item><title>s3cmd s3命令行工具</title><link>https://blog.chenguixian.com/post/op/s3cmd-configuration-usage-guide/</link><pubDate>Sat, 20 Dec 2025 21:31:26 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/s3cmd-configuration-usage-guide/</guid><description>&lt;h2 id="1-工具概述">1. &lt;strong>工具概述&lt;/strong>&lt;/h2>
&lt;p>s3cmd是Amazon S3的命令行客户端工具，用于访问和管理S3存储桶（类似于根文件夹），支持文件上传、下载、同步、删除等操作，还可用作S3备份工具。&lt;/p></description></item><item><title>Redis 不同架构搭建实践指南</title><link>https://blog.chenguixian.com/post/op/redis-setup-guide/</link><pubDate>Sat, 20 Sep 2025 21:31:26 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/redis-setup-guide/</guid><description>&lt;p>本文介绍Redis在不同系统环境下的安装配置方法，并提供了安装验证脚本。详细讲解了主从复制架构的搭建步骤，包含1个主节点和2个从节点的配置示例（端口、持久化、日志、安全等设置）。同时提供了版本兼容性检查脚本，支持Redis 4.x和5.0+版本。所有配置文件和脚本都存放在~/redis-practice目录下，便于实践Redis的各种架构模式（主从复制、集群、哨兵）。&lt;/p></description></item><item><title>迁移 kong 中的 PostgreSQL 数据库</title><link>https://blog.chenguixian.com/post/op/migrate-pg-databse/</link><pubDate>Sat, 01 Mar 2025 21:31:26 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/migrate-pg-databse/</guid><description>&lt;h2 id="迁移-kong-中的-postgresql-数据库">迁移 kong 中的 PostgreSQL 数据库&lt;/h2>
&lt;h3 id="背景">背景&lt;/h3>
&lt;p>最近需要进行部署环境的迁移，原先 kong 使用的 PostgreSQL 数据库是几年前部署的了，一下子把命令全部忘光了。所以操作完成之后做个简单的记录。以下描述是基于 9.6 的，不适用于最新版本。&lt;/p></description></item><item><title>Debian 的发行版</title><link>https://blog.chenguixian.com/post/op/debian-version/</link><pubDate>Wed, 12 Jul 2023 21:31:26 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/debian-version/</guid><description>&lt;h2 id="debian-的版本">Debian 的版本&lt;/h2>
&lt;p>Debian各个发行版及其代号：&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">Debian 1.1 - Buzz
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 1.2 - Rex
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 1.3 - Bo
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 2.0 - Hamm
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 2.1 - Slink
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 2.2 - Potato
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 3.0 - Woody
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 3.1 - Sarge
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 4.0 - Etch
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 5.0 - Lenny
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 6.0 - Squeeze
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 7.0 - Wheezy
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 8.0 - Jessie
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 9.0 - Stretch
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 10 - Buster
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 11 - Bullseye
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Debian 12 - Bookworm
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>每个版本都有一个代号，代号通常是以一个卡通人物的名字命名，例如Squeeze是以Toy Story中的角色命名的。这些代号通常是从Debian开发团队中选出来的，旨在使每个版本都有一个独特的标识符。&lt;/p></description></item><item><title>MacOS 使用 ssh-agent 实现跳板登录</title><link>https://blog.chenguixian.com/post/op/ssh-agent-forwarding/</link><pubDate>Thu, 06 Jul 2023 20:30:12 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/ssh-agent-forwarding/</guid><description>&lt;p>在实际工作中，我们经常需要通过跳板主机来访问目标主机。这时候，如果我们使用 SSH 进行远程连接，就需要在本地计算机上使用 ssh-agent 来实现跳板登录。下面，本文将介绍如何使用 ssh-agent 实现跳板登录。&lt;/p></description></item><item><title>MySQL 频频出现慢日志，你该怎么办？</title><link>https://blog.chenguixian.com/post/op/mysql-slowlog/</link><pubDate>Thu, 15 Jun 2023 21:31:26 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/mysql-slowlog/</guid><description>&lt;blockquote>
&lt;p>在日常工作中，不少研发人员会因为 “慢日志” 头疼不已，“慢日志”造成的数据库性能问题（比如锁等待、并发访问资源消耗等）绝对占据数据库性能问题的 TOP 1，如果你用不合理的优化方法，比如添加不合理的索引、被动进行优化等，效率很低，所以除了要重视慢日志之外，更要有一个合理的优化方法，不让问题积少成多。&lt;/p></description></item><item><title>SSH 配置文件简单指南</title><link>https://blog.chenguixian.com/post/op/ssh-config/</link><pubDate>Wed, 15 Sep 2021 15:54:09 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/ssh-config/</guid><description>&lt;h2 id="前言">前言&lt;/h2>
&lt;p>如果我们有许多服务器需要连接，并且这些机器存在不同的用户名、端口或者其他的选项，如果在去连接的时候记住这些内容是很麻烦和影响效率的事情。当然我们也可以采用 alias 来简化某些场景下的使用。
本文主要是介绍在 ssh 配置文件中对不同服务器单独设置一些参数（比如端口、用户名）。&lt;/p></description></item><item><title>Nginx location 和 proxy_pass</title><link>https://blog.chenguixian.com/post/op/nginx-location-proxy_pass/</link><pubDate>Fri, 03 Sep 2021 19:39:31 +0800</pubDate><guid>https://blog.chenguixian.com/post/op/nginx-location-proxy_pass/</guid><description>&lt;h2 id="location">Location&lt;/h2>
&lt;p>Nginx location 用于匹配请求 URI，匹配上之后按照其定义的方式对该请求进行处理。&lt;a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#location">loacation 官方说明&lt;/a>&lt;/p>
&lt;h3 id="语法">语法&lt;/h3>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">Syntax:	location [ = | ~ | ~* | ^~ ] uri { ... }
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">location @name { ... }
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Default:	—
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Context:	server, location
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="匹配命令">匹配命令&lt;/h3>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th style="text-align: left">参数/修饰符&lt;/th>
 &lt;th style="text-align: left">说明&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td style="text-align: left">空&lt;/td>
 &lt;td style="text-align: left">location 后没有参数直接跟着 &lt;strong>标准 URI&lt;/strong>，表示前缀匹配，代表跟请求中的 URI 从头开始匹配。&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">=&lt;/td>
 &lt;td style="text-align: left">精确匹配，用于&lt;strong>标准 URI&lt;/strong> 前，要求请求字符串与其精准匹配，成功则立即处理，Nginx 停止搜索其他匹配。&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">~&lt;/td>
 &lt;td style="text-align: left">用于&lt;strong>正则 URI&lt;/strong> 前，表示 URI 包含正则表达式， &lt;strong>区分&lt;/strong>大小写&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">~*&lt;/td>
 &lt;td style="text-align: left">用于&lt;strong>正则 URI&lt;/strong> 前， 表示 URI 包含正则表达式， &lt;strong>不区分&lt;/strong>大小写&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">^~&lt;/td>
 &lt;td style="text-align: left">用于&lt;strong>标准 URI&lt;/strong> 前，最长非正则匹配，并要求一旦匹配到就会立即处理，不再去匹配其他的。&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">@&lt;/td>
 &lt;td style="text-align: left">@ 定义一个命名的 location，@ 定义的locaiton名字一般用在内部定向，例如error_page, try_files命令中。它的功能类似于编程中的goto。&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">/&lt;/td>
 &lt;td style="text-align: left">通用匹配, 如果没有其它匹配,任何请求都会匹配到&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h3 id="匹配顺序">匹配顺序&lt;/h3>
&lt;blockquote>
&lt;p>To find location matching a given request, nginx first checks locations defined using the prefix strings (prefix locations). Among them, the location with the longest matching prefix is selected and remembered. Then regular expressions are checked, in the order of their appearance in the configuration file. The search of regular expressions terminates on the first match, and the corresponding configuration is used. If no match with a regular expression is found then the configuration of the prefix location remembered earlier is used.&lt;/p></description></item></channel></rss>