From 9d9c2e72b62f1cc61413e2ee0141c4d28aff688e Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: 2020年6月16日 07:18:01 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/linux/ops/crontab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linux/ops/crontab.md b/docs/linux/ops/crontab.md index 29139e61..1fd9eca3 100644 --- a/docs/linux/ops/crontab.md +++ b/docs/linux/ops/crontab.md @@ -65,7 +65,7 @@ crontab 要执行的定时任务都被保存在 `/etc/crontab` 文件中。 crontab 的文件格式如下: -![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200211113339.png) +![img](http://dunwu.test.upcdn.net/snap/20200211113339.png) #### 标准字段 From 42f2b4ea8a55267484602f3d71f557afcac0c5ea Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: 2020年6月24日 10:56:56 +0800 Subject: [PATCH 02/20] =?UTF-8?q?Redis=20=E4=B8=BB=E4=BB=8E=E9=9B=86?= =?UTF-8?q?=E7=BE=A4+=E5=93=A8=E5=85=B5=E6=A8=A1=E5=BC=8F=20=E7=9A=84?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC=E3=80=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/redis/cluster/26381/sentinel.conf | 8 ++ .../config/redis/cluster/26382/sentinel.conf | 8 ++ .../config/redis/cluster/26383/sentinel.conf | 8 ++ .../soft/config/redis/cluster/6381/redis.conf | 8 +- .../soft/config/redis/cluster/6382/redis.conf | 8 +- .../soft/config/redis/cluster/6383/redis.conf | 8 +- .../soft/config/redis/cluster/6384/redis.conf | 8 +- .../soft/config/redis/cluster/6385/redis.conf | 8 +- .../soft/config/redis/cluster/6386/redis.conf | 8 +- .../soft/config/redis/cluster/6387/redis.conf | 12 ++ .../soft/config/redis/cluster/6388/redis.conf | 12 ++ .../soft/config/redis/cluster/6389/redis.conf | 12 ++ .../linux/soft/config/redis/cluster/README.md | 53 +++++++++ .../soft/config/redis/cluster/create-cluster | 102 +++++++++++++++++ .../config/redis/cluster/redis-cluster.sh | 104 ------------------ .../config/redis/cluster/start-cluster.sh | 19 ++++ .../config/redis/cluster/start-sentinel.sh | 3 + 17 files changed, 261 insertions(+), 128 deletions(-) create mode 100644 codes/linux/soft/config/redis/cluster/26381/sentinel.conf create mode 100644 codes/linux/soft/config/redis/cluster/26382/sentinel.conf create mode 100644 codes/linux/soft/config/redis/cluster/26383/sentinel.conf create mode 100644 codes/linux/soft/config/redis/cluster/6387/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/6388/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/6389/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/README.md create mode 100644 codes/linux/soft/config/redis/cluster/create-cluster delete mode 100644 codes/linux/soft/config/redis/cluster/redis-cluster.sh create mode 100644 codes/linux/soft/config/redis/cluster/start-cluster.sh create mode 100644 codes/linux/soft/config/redis/cluster/start-sentinel.sh diff --git a/codes/linux/soft/config/redis/cluster/26381/sentinel.conf b/codes/linux/soft/config/redis/cluster/26381/sentinel.conf new file mode 100644 index 00000000..a4b3f94f --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/26381/sentinel.conf @@ -0,0 +1,8 @@ +port 26381 +daemonize yes +sentinel monitor redis-master 172.22.6.3 6381 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/26381/26381.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/26382/sentinel.conf b/codes/linux/soft/config/redis/cluster/26382/sentinel.conf new file mode 100644 index 00000000..db20a61d --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/26382/sentinel.conf @@ -0,0 +1,8 @@ +port 26382 +daemonize yes +sentinel monitor redis-master 172.22.6.3 6382 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/26382/26382.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/26383/sentinel.conf b/codes/linux/soft/config/redis/cluster/26383/sentinel.conf new file mode 100644 index 00000000..fc5af052 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/26383/sentinel.conf @@ -0,0 +1,8 @@ +port 26383 +daemonize yes +sentinel monitor redis-master 172.22.6.3 6383 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/26383/26383.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/6381/redis.conf b/codes/linux/soft/config/redis/cluster/6381/redis.conf index 943eff09..054c1f04 100644 --- a/codes/linux/soft/config/redis/cluster/6381/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6381/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6381/6381.conf +cluster-config-file /usr/local/redis/conf/6381/6381.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6381 -pidfile /var/run/redis/redis-6381.pid -logfile /usr/local/redis/cluster/6381/6381.log +dir /usr/local/redis/conf/6381 +pidfile /usr/local/redis/conf/6381/6381.pid +logfile /usr/local/redis/conf/6381/6381.log diff --git a/codes/linux/soft/config/redis/cluster/6382/redis.conf b/codes/linux/soft/config/redis/cluster/6382/redis.conf index 7f1406c3..d5d62e1a 100644 --- a/codes/linux/soft/config/redis/cluster/6382/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6382/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6382/6382.conf +cluster-config-file /usr/local/redis/conf/6382/6382.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6382 -pidfile /var/run/redis/redis-6382.pid -logfile /usr/local/redis/cluster/6382/6382.log +dir /usr/local/redis/conf/6382 +pidfile /usr/local/redis/conf/6382/6382.pid +logfile /usr/local/redis/conf/6382/6382.log diff --git a/codes/linux/soft/config/redis/cluster/6383/redis.conf b/codes/linux/soft/config/redis/cluster/6383/redis.conf index 22d2aa87..41e10ee3 100644 --- a/codes/linux/soft/config/redis/cluster/6383/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6383/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6383/6383.conf +cluster-config-file /usr/local/redis/conf/6383/6383.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6383 -pidfile /var/run/redis/redis-6383.pid -logfile /usr/local/redis/cluster/6383/6383.log +dir /usr/local/redis/conf/6383 +pidfile /usr/local/redis/conf/6383/6383.pid +logfile /usr/local/redis/conf/6383/6383.log diff --git a/codes/linux/soft/config/redis/cluster/6384/redis.conf b/codes/linux/soft/config/redis/cluster/6384/redis.conf index b2756e64..b57fef5e 100644 --- a/codes/linux/soft/config/redis/cluster/6384/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6384/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6384/6384.conf +cluster-config-file /usr/local/redis/conf/6384/6384.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6384 -pidfile /var/run/redis/redis-6384.pid -logfile /usr/local/redis/cluster/6384/6384.log +dir /usr/local/redis/conf/6384 +pidfile /usr/local/redis/conf/6384/6384.pid +logfile /usr/local/redis/conf/6384/6384.log diff --git a/codes/linux/soft/config/redis/cluster/6385/redis.conf b/codes/linux/soft/config/redis/cluster/6385/redis.conf index 28d36cf8..7535e79d 100644 --- a/codes/linux/soft/config/redis/cluster/6385/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6385/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6385/6385.conf +cluster-config-file /usr/local/redis/conf/6385/6385.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6385 -pidfile /var/run/redis/redis-6385.pid -logfile /usr/local/redis/cluster/6385/6385.log +dir /usr/local/redis/conf/6385 +pidfile /usr/local/redis/conf/6385/6385.pid +logfile /usr/local/redis/conf/6385/6385.log diff --git a/codes/linux/soft/config/redis/cluster/6386/redis.conf b/codes/linux/soft/config/redis/cluster/6386/redis.conf index 5ab8bf7c..03f1127d 100644 --- a/codes/linux/soft/config/redis/cluster/6386/redis.conf +++ b/codes/linux/soft/config/redis/cluster/6386/redis.conf @@ -3,10 +3,10 @@ bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/cluster/6386/6386.conf +cluster-config-file /usr/local/redis/conf/6386/6386.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/cluster/6386 -pidfile /var/run/redis/redis-6386.pid -logfile /usr/local/redis/cluster/6386/6386.log +dir /usr/local/redis/conf/6386 +pidfile /usr/local/redis/conf/6386/6386.pid +logfile /usr/local/redis/conf/6386/6386.log diff --git a/codes/linux/soft/config/redis/cluster/6387/redis.conf b/codes/linux/soft/config/redis/cluster/6387/redis.conf new file mode 100644 index 00000000..31ccfe90 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/6387/redis.conf @@ -0,0 +1,12 @@ +port 6387 +bind 0.0.0.0 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/6387/6387.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/6387 +pidfile /usr/local/redis/conf/6387/6387.pid +logfile /usr/local/redis/conf/6387/6387.log diff --git a/codes/linux/soft/config/redis/cluster/6388/redis.conf b/codes/linux/soft/config/redis/cluster/6388/redis.conf new file mode 100644 index 00000000..6f159f9a --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/6388/redis.conf @@ -0,0 +1,12 @@ +port 6388 +bind 0.0.0.0 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/6388/6388.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/6388 +pidfile /usr/local/redis/conf/6388/6388.pid +logfile /usr/local/redis/conf/6388/6388.log diff --git a/codes/linux/soft/config/redis/cluster/6389/redis.conf b/codes/linux/soft/config/redis/cluster/6389/redis.conf new file mode 100644 index 00000000..e9a17b3e --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/6389/redis.conf @@ -0,0 +1,12 @@ +port 6389 +bind 0.0.0.0 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/6389/6389.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/6389 +pidfile /usr/local/redis/conf/6389/6389.pid +logfile /usr/local/redis/conf/6389/6389.log diff --git a/codes/linux/soft/config/redis/cluster/README.md b/codes/linux/soft/config/redis/cluster/README.md new file mode 100644 index 00000000..3d379085 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/README.md @@ -0,0 +1,53 @@ +# Redis 集群配置 + +## 使用方式 + +集群拓扑: + +- 三主六从,每个主节点有两个从节点。 +- 三哨兵,分别监听其中一个主节点。 + +启动方式: + +- 先执行 start-cluster.sh,会自动根据 6381 ~ 6389 目录启动服务器,并将其配置为集群。 +- 再执行 start-sentinel.sh,会根据 26381 ~ 26383 目录启动哨兵,监听集群中的三个主节点。 + +## 配置 + +(1)集群服务器配置 redis.conf + +``` +port 6381 +bind 0.0.0.0 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/6381/6381.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/6381 +pidfile /usr/local/redis/conf/6381/6381.pid +logfile /usr/local/redis/conf/6381/6381.log +``` + +端口号、配置目录(`/usr/local/redis/conf`)根据实际情况修改。 + +(2)哨兵服务器配置 sentinel.conf + +``` +port 26383 +daemonize yes +sentinel monitor redis-master 172.22.6.3 6383 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/26383/26383.log +``` + +端口号、配置目录(`/usr/local/redis/conf`)根据实际情况修改。 + +最重要的配置在于:sentinel monitor redis-master 172.22.6.3 6383 2 + +表示监听的服务器集群名叫 redis-master,当前哨兵监听的服务器节点是:172.22.6.3:6383,这个节点如果是主节点,一旦宕机,选举新的主节点,需要至少 2 个哨兵同意。 \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/create-cluster b/codes/linux/soft/config/redis/cluster/create-cluster new file mode 100644 index 00000000..ac133a59 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/create-cluster @@ -0,0 +1,102 @@ +#!/bin/bash + +# Settings +PORT=6380 +TIMEOUT=2000 +NODES=6 +REPLICAS=1 + +# You may want to put the above config parameters into config.sh in order to +# override the defaults without modifying this script. + +if [ -a config.sh ] +then + source "config.sh" +fi + +# Computed vars +ENDPORT=$((PORT+NODES)) + +if [ "1ドル" == "start" ] +then + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + echo "Starting $PORT" + /opt/redis/src/redis-server /usr/local/redis/conf/${PORT}/redis.conf + done + exit 0 +fi + +if [ "1ドル" == "create" ] +then + HOSTS="" + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + HOSTS="$HOSTS 127.0.0.1:$PORT" + done + /opt/redis/src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS + exit 0 +fi + +if [ "1ドル" == "stop" ] +then + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + echo "Stopping $PORT" + /opt/redis/src/redis-cli -p $PORT shutdown nosave + done + exit 0 +fi + +if [ "1ドル" == "watch" ] +then + PORT=$((PORT+1)) + while [ 1 ]; do + clear + date + /opt/redis/src/redis-cli -p $PORT cluster nodes | head -30 + sleep 1 + done + exit 0 +fi + +if [ "1ドル" == "tail" ] +then + INSTANCE=2ドル + PORT=$((PORT+INSTANCE)) + tail -f ${PORT}.log + exit 0 +fi + +if [ "1ドル" == "call" ] +then + while [ $((PORT < ENDPORT)) != "0" ]; do + PORT=$((PORT+1)) + /opt/redis/src/redis-cli -p $PORT 2ドル 3ドル 4ドル 5ドル 6ドル 7ドル 8ドル 9ドル + done + exit 0 +fi + +if [ "1ドル" == "clean" ] +then + rm -rf *.log + rm -rf appendonly*.aof + rm -rf dump*.rdb + rm -rf nodes*.conf + exit 0 +fi + +if [ "1ドル" == "clean-logs" ] +then + rm -rf *.log + exit 0 +fi + +echo "Usage: 0ドル [start|create|stop|watch|tail|clean]" +echo "start -- Launch Redis Cluster instances." +echo "create -- Create a cluster using redis-cli --cluster create." +echo "stop -- Stop Redis Cluster instances." +echo "watch -- Show CLUSTER NODES output (first 30 lines) of first node." +echo "tail -- Run tail -f of instance at base port + ID." +echo "clean -- Remove all instances data, logs, configs." +echo "clean-logs -- Remove just instances logs." diff --git a/codes/linux/soft/config/redis/cluster/redis-cluster.sh b/codes/linux/soft/config/redis/cluster/redis-cluster.sh deleted file mode 100644 index 23a0051b..00000000 --- a/codes/linux/soft/config/redis/cluster/redis-cluster.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env bash - -# --------------------------------------------------------------------------------- -# 控制台颜色 -BLACK="033円[1;30m" -RED="033円[1;31m" -GREEN="033円[1;32m" -YELLOW="033円[1;33m" -BLUE="033円[1;34m" -PURPLE="033円[1;35m" -CYAN="033円[1;36m" -RESET="$(tput sgr0)" -# --------------------------------------------------------------------------------- - -printf "${BLUE}\n" -cat << EOF -################################################################################### -# Redis 集群控制脚本 -# @system: 适用于 CentOS7+ -# @author: Zhang Peng -################################################################################### -EOF -printf "${RESET}\n" - -# Settings -PORT=6380 -NODES=6 -ENDPORT=$((PORT + NODES)) -TIMEOUT=2000 -REPLICAS=0 -PATH="/usr/local/redis" - -######################################## MAIN ######################################## -printf "${PURPLE}\n" -printf "Usage: 0ドル [start|create|stop|watch|tail|clean]\n" -printf "start -- Launch Redis Cluster instances.\n" -printf "create -- Create a cluster using redis-cli --cluster create.\n" -printf "stop -- Stop Redis Cluster instances.\n" -printf "watch -- Show CLUSTER NODES output (first 30 lines) of first node.\n" -printf "tail -- Run tail -f of instance at base port + ID.\n" -printf "clean -- Remove all instances data, logs, configs.\n" -printf "clean-logs -- Remove just instances logs.\n" -printf "${RESET}\n" - -case 1ドル in - "start") - while [[ $((PORT < ENDPORT)) != "0" ]]; do - PORT=$((PORT + 1)) - echo "Starting $PORT" - if [[ -e "${PATH}/cluster/${PORT}/redis.conf" ]]; then - ${PATH}/src/redis-server "${PATH}/cluster/${PORT}/redis.conf" - fi - done - ;; - "create") - HOSTS="" - while [[ $((PORT < ENDPORT)) != "0" ]]; do - PORT=$((PORT + 1)) - HOSTS="$HOSTS 127.0.0.1:$PORT" - done - ${PATH}/src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS - ;; - "stop") - while [[ $((PORT < ENDPORT)) != "0" ]]; do - PORT=$((PORT + 1)) - echo "Stopping $PORT" - ${PATH}/src/redis-cli -p $PORT shutdown nosave - done - ;; - "watch") - PORT=$((PORT + 1)) - while [[ 1 ]]; do - clear - date - ${PATH}/src/redis-cli -p $PORT cluster nodes | head -30 - sleep 1 - done - ;; - "tail") - INSTANCE=2ドル - PORT=$((PORT + INSTANCE)) - tail -f ${PORT}.log - ;; - "call") - while [[ $((PORT < ENDPORT)) != "0" ]]; do - PORT=$((PORT + 1)) - ${PATH}/src/redis-cli -p $PORT 2ドル 3ドル 4ドル 5ドル 6ドル 7ドル 8ドル 9ドル - done - ;; - "clean") - rm -rf **/*.log - rm -rf **/appendonly*.aof - rm -rf **/dump*.rdb - rm -rf **/nodes*.conf - ;; - "clean-logs") - rm -rf **/*.log - ;; - "exit") - printf "${RED}Invalid option!${RESET}\n" - main - exit 0 - ;; -esac diff --git a/codes/linux/soft/config/redis/cluster/start-cluster.sh b/codes/linux/soft/config/redis/cluster/start-cluster.sh new file mode 100644 index 00000000..71eb01cc --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/start-cluster.sh @@ -0,0 +1,19 @@ +/opt/redis/src/redis-server /usr/local/redis/conf/6381/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6382/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6383/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6384/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6385/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6386/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6387/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6388/redis.conf + +/opt/redis/src/redis-server /usr/local/redis/conf/6389/redis.conf + +/opt/redis/src/redis-cli --cluster create 172.22.6.3:6381 172.22.6.3:6382 172.22.6.3:6383 172.22.6.3:6384 172.22.6.3:6385 172.22.6.3:6386 172.22.6.3:6387 172.22.6.3:6388 172.22.6.3:6389 --cluster-replicas 2 diff --git a/codes/linux/soft/config/redis/cluster/start-sentinel.sh b/codes/linux/soft/config/redis/cluster/start-sentinel.sh new file mode 100644 index 00000000..9b146735 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/start-sentinel.sh @@ -0,0 +1,3 @@ +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26381/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26382/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26383/sentinel.conf From b6d9c81ffbc2a402c592797719836c5ac5c8ff26 Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: 2020年7月16日 11:21:46 +0800 Subject: [PATCH 03/20] =?UTF-8?q?Redis=20Cluster=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cluster/{26381 => 27001}/sentinel.conf | 6 +- .../cluster/{26382 => 27002}/sentinel.conf | 6 +- .../cluster/{26383 => 27003}/sentinel.conf | 6 +- .../config/redis/cluster/27004/sentinel.conf | 8 ++ .../config/redis/cluster/27005/sentinel.conf | 8 ++ .../config/redis/cluster/27006/sentinel.conf | 8 ++ .../soft/config/redis/cluster/6381/redis.conf | 12 --- .../soft/config/redis/cluster/6382/redis.conf | 12 --- .../soft/config/redis/cluster/6383/redis.conf | 12 --- .../soft/config/redis/cluster/6384/redis.conf | 12 --- .../soft/config/redis/cluster/6385/redis.conf | 12 --- .../soft/config/redis/cluster/6386/redis.conf | 12 --- .../soft/config/redis/cluster/6387/redis.conf | 12 --- .../soft/config/redis/cluster/6388/redis.conf | 12 --- .../soft/config/redis/cluster/6389/redis.conf | 12 --- .../soft/config/redis/cluster/7001/redis.conf | 12 +++ .../soft/config/redis/cluster/7002/redis.conf | 12 +++ .../soft/config/redis/cluster/7003/redis.conf | 12 +++ .../soft/config/redis/cluster/7004/redis.conf | 12 +++ .../soft/config/redis/cluster/7005/redis.conf | 12 +++ .../soft/config/redis/cluster/7006/redis.conf | 12 +++ .../soft/config/redis/cluster/7007/redis.conf | 12 +++ .../soft/config/redis/cluster/7008/redis.conf | 12 +++ .../soft/config/redis/cluster/7009/redis.conf | 12 +++ .../soft/config/redis/cluster/7010/redis.conf | 12 +++ .../soft/config/redis/cluster/7011/redis.conf | 12 +++ .../soft/config/redis/cluster/7012/redis.conf | 12 +++ .../linux/soft/config/redis/cluster/README.md | 28 ++--- .../{create-cluster => redis-cluster.sh} | 51 +++++---- .../config/redis/cluster/redis-cluster2.sh | 101 ++++++++++++++++++ .../config/redis/cluster/start-cluster.sh | 40 +++---- .../config/redis/cluster/start-cluster2.sh | 18 ++++ .../config/redis/cluster/start-sentinel.sh | 9 +- codes/linux/soft/config/redis/redis.conf | 2 +- 34 files changed, 363 insertions(+), 180 deletions(-) rename codes/linux/soft/config/redis/cluster/{26381 => 27001}/sentinel.conf (64%) rename codes/linux/soft/config/redis/cluster/{26382 => 27002}/sentinel.conf (64%) rename codes/linux/soft/config/redis/cluster/{26383 => 27003}/sentinel.conf (64%) create mode 100644 codes/linux/soft/config/redis/cluster/27004/sentinel.conf create mode 100644 codes/linux/soft/config/redis/cluster/27005/sentinel.conf create mode 100644 codes/linux/soft/config/redis/cluster/27006/sentinel.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6381/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6382/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6383/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6384/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6385/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6386/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6387/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6388/redis.conf delete mode 100644 codes/linux/soft/config/redis/cluster/6389/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7001/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7002/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7003/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7004/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7005/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7006/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7007/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7008/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7009/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7010/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7011/redis.conf create mode 100644 codes/linux/soft/config/redis/cluster/7012/redis.conf rename codes/linux/soft/config/redis/cluster/{create-cluster => redis-cluster.sh} (63%) create mode 100644 codes/linux/soft/config/redis/cluster/redis-cluster2.sh create mode 100644 codes/linux/soft/config/redis/cluster/start-cluster2.sh diff --git a/codes/linux/soft/config/redis/cluster/26381/sentinel.conf b/codes/linux/soft/config/redis/cluster/27001/sentinel.conf similarity index 64% rename from codes/linux/soft/config/redis/cluster/26381/sentinel.conf rename to codes/linux/soft/config/redis/cluster/27001/sentinel.conf index a4b3f94f..0b7a6f02 100644 --- a/codes/linux/soft/config/redis/cluster/26381/sentinel.conf +++ b/codes/linux/soft/config/redis/cluster/27001/sentinel.conf @@ -1,8 +1,8 @@ -port 26381 +port 27001 daemonize yes -sentinel monitor redis-master 172.22.6.3 6381 2 +sentinel monitor redis-master 172.22.6.3 7001 2 sentinel down-after-milliseconds redis-master 5000 sentinel failover-timeout redis-master 900000 sentinel parallel-syncs redis-master 1 #sentinel auth-pass redis-master 123456 -logfile /usr/local/redis/conf/26381/26381.log \ No newline at end of file +logfile /usr/local/redis/conf/27001/27001.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/26382/sentinel.conf b/codes/linux/soft/config/redis/cluster/27002/sentinel.conf similarity index 64% rename from codes/linux/soft/config/redis/cluster/26382/sentinel.conf rename to codes/linux/soft/config/redis/cluster/27002/sentinel.conf index db20a61d..d208d9e4 100644 --- a/codes/linux/soft/config/redis/cluster/26382/sentinel.conf +++ b/codes/linux/soft/config/redis/cluster/27002/sentinel.conf @@ -1,8 +1,8 @@ -port 26382 +port 27002 daemonize yes -sentinel monitor redis-master 172.22.6.3 6382 2 +sentinel monitor redis-master 172.22.6.3 7002 2 sentinel down-after-milliseconds redis-master 5000 sentinel failover-timeout redis-master 900000 sentinel parallel-syncs redis-master 1 #sentinel auth-pass redis-master 123456 -logfile /usr/local/redis/conf/26382/26382.log \ No newline at end of file +logfile /usr/local/redis/conf/27002/27002.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/26383/sentinel.conf b/codes/linux/soft/config/redis/cluster/27003/sentinel.conf similarity index 64% rename from codes/linux/soft/config/redis/cluster/26383/sentinel.conf rename to codes/linux/soft/config/redis/cluster/27003/sentinel.conf index fc5af052..c6d8588a 100644 --- a/codes/linux/soft/config/redis/cluster/26383/sentinel.conf +++ b/codes/linux/soft/config/redis/cluster/27003/sentinel.conf @@ -1,8 +1,8 @@ -port 26383 +port 27003 daemonize yes -sentinel monitor redis-master 172.22.6.3 6383 2 +sentinel monitor redis-master 172.22.6.3 7003 2 sentinel down-after-milliseconds redis-master 5000 sentinel failover-timeout redis-master 900000 sentinel parallel-syncs redis-master 1 #sentinel auth-pass redis-master 123456 -logfile /usr/local/redis/conf/26383/26383.log \ No newline at end of file +logfile /usr/local/redis/conf/27003/27003.log \ No newline at end of file diff --git a/codes/linux/soft/config/redis/cluster/27004/sentinel.conf b/codes/linux/soft/config/redis/cluster/27004/sentinel.conf new file mode 100644 index 00000000..39f10881 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/27004/sentinel.conf @@ -0,0 +1,8 @@ +port 27004 +daemonize yes +sentinel monitor redis-master 172.22.6.3 7007 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/27004/27004.log diff --git a/codes/linux/soft/config/redis/cluster/27005/sentinel.conf b/codes/linux/soft/config/redis/cluster/27005/sentinel.conf new file mode 100644 index 00000000..a33aa836 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/27005/sentinel.conf @@ -0,0 +1,8 @@ +port 27005 +daemonize yes +sentinel monitor redis-master 172.22.6.3 7008 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/27005/27005.log diff --git a/codes/linux/soft/config/redis/cluster/27006/sentinel.conf b/codes/linux/soft/config/redis/cluster/27006/sentinel.conf new file mode 100644 index 00000000..a006f15e --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/27006/sentinel.conf @@ -0,0 +1,8 @@ +port 27006 +daemonize yes +sentinel monitor redis-master 172.22.6.3 7009 2 +sentinel down-after-milliseconds redis-master 5000 +sentinel failover-timeout redis-master 900000 +sentinel parallel-syncs redis-master 1 +#sentinel auth-pass redis-master 123456 +logfile /usr/local/redis/conf/27006/27006.log diff --git a/codes/linux/soft/config/redis/cluster/6381/redis.conf b/codes/linux/soft/config/redis/cluster/6381/redis.conf deleted file mode 100644 index 054c1f04..00000000 --- a/codes/linux/soft/config/redis/cluster/6381/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6381 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6381/6381.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6381 -pidfile /usr/local/redis/conf/6381/6381.pid -logfile /usr/local/redis/conf/6381/6381.log diff --git a/codes/linux/soft/config/redis/cluster/6382/redis.conf b/codes/linux/soft/config/redis/cluster/6382/redis.conf deleted file mode 100644 index d5d62e1a..00000000 --- a/codes/linux/soft/config/redis/cluster/6382/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6382 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6382/6382.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6382 -pidfile /usr/local/redis/conf/6382/6382.pid -logfile /usr/local/redis/conf/6382/6382.log diff --git a/codes/linux/soft/config/redis/cluster/6383/redis.conf b/codes/linux/soft/config/redis/cluster/6383/redis.conf deleted file mode 100644 index 41e10ee3..00000000 --- a/codes/linux/soft/config/redis/cluster/6383/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6383 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6383/6383.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6383 -pidfile /usr/local/redis/conf/6383/6383.pid -logfile /usr/local/redis/conf/6383/6383.log diff --git a/codes/linux/soft/config/redis/cluster/6384/redis.conf b/codes/linux/soft/config/redis/cluster/6384/redis.conf deleted file mode 100644 index b57fef5e..00000000 --- a/codes/linux/soft/config/redis/cluster/6384/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6384 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6384/6384.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6384 -pidfile /usr/local/redis/conf/6384/6384.pid -logfile /usr/local/redis/conf/6384/6384.log diff --git a/codes/linux/soft/config/redis/cluster/6385/redis.conf b/codes/linux/soft/config/redis/cluster/6385/redis.conf deleted file mode 100644 index 7535e79d..00000000 --- a/codes/linux/soft/config/redis/cluster/6385/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6385 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6385/6385.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6385 -pidfile /usr/local/redis/conf/6385/6385.pid -logfile /usr/local/redis/conf/6385/6385.log diff --git a/codes/linux/soft/config/redis/cluster/6386/redis.conf b/codes/linux/soft/config/redis/cluster/6386/redis.conf deleted file mode 100644 index 03f1127d..00000000 --- a/codes/linux/soft/config/redis/cluster/6386/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6386 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6386/6386.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6386 -pidfile /usr/local/redis/conf/6386/6386.pid -logfile /usr/local/redis/conf/6386/6386.log diff --git a/codes/linux/soft/config/redis/cluster/6387/redis.conf b/codes/linux/soft/config/redis/cluster/6387/redis.conf deleted file mode 100644 index 31ccfe90..00000000 --- a/codes/linux/soft/config/redis/cluster/6387/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6387 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6387/6387.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6387 -pidfile /usr/local/redis/conf/6387/6387.pid -logfile /usr/local/redis/conf/6387/6387.log diff --git a/codes/linux/soft/config/redis/cluster/6388/redis.conf b/codes/linux/soft/config/redis/cluster/6388/redis.conf deleted file mode 100644 index 6f159f9a..00000000 --- a/codes/linux/soft/config/redis/cluster/6388/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6388 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6388/6388.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6388 -pidfile /usr/local/redis/conf/6388/6388.pid -logfile /usr/local/redis/conf/6388/6388.log diff --git a/codes/linux/soft/config/redis/cluster/6389/redis.conf b/codes/linux/soft/config/redis/cluster/6389/redis.conf deleted file mode 100644 index e9a17b3e..00000000 --- a/codes/linux/soft/config/redis/cluster/6389/redis.conf +++ /dev/null @@ -1,12 +0,0 @@ -port 6389 -bind 0.0.0.0 -daemonize yes - -cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6389/6389.conf -cluster-node-timeout 10000 - -appendonly yes -dir /usr/local/redis/conf/6389 -pidfile /usr/local/redis/conf/6389/6389.pid -logfile /usr/local/redis/conf/6389/6389.log diff --git a/codes/linux/soft/config/redis/cluster/7001/redis.conf b/codes/linux/soft/config/redis/cluster/7001/redis.conf new file mode 100644 index 00000000..34bd0216 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7001/redis.conf @@ -0,0 +1,12 @@ +port 7001 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7001/7001.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7001 +pidfile /usr/local/redis/conf/7001/7001.pid +logfile /usr/local/redis/conf/7001/7001.log diff --git a/codes/linux/soft/config/redis/cluster/7002/redis.conf b/codes/linux/soft/config/redis/cluster/7002/redis.conf new file mode 100644 index 00000000..5e7fbc0d --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7002/redis.conf @@ -0,0 +1,12 @@ +port 7002 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7002/7002.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7002 +pidfile /usr/local/redis/conf/7002/7002.pid +logfile /usr/local/redis/conf/7002/7002.log diff --git a/codes/linux/soft/config/redis/cluster/7003/redis.conf b/codes/linux/soft/config/redis/cluster/7003/redis.conf new file mode 100644 index 00000000..e87573dd --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7003/redis.conf @@ -0,0 +1,12 @@ +port 7003 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7003/7003.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7003 +pidfile /usr/local/redis/conf/7003/7003.pid +logfile /usr/local/redis/conf/7003/7003.log diff --git a/codes/linux/soft/config/redis/cluster/7004/redis.conf b/codes/linux/soft/config/redis/cluster/7004/redis.conf new file mode 100644 index 00000000..1b4d6089 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7004/redis.conf @@ -0,0 +1,12 @@ +port 7004 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7004/7004.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7004 +pidfile /usr/local/redis/conf/7004/7004.pid +logfile /usr/local/redis/conf/7004/7004.log diff --git a/codes/linux/soft/config/redis/cluster/7005/redis.conf b/codes/linux/soft/config/redis/cluster/7005/redis.conf new file mode 100644 index 00000000..d959a8d6 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7005/redis.conf @@ -0,0 +1,12 @@ +port 7005 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7005/7005.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7005 +pidfile /usr/local/redis/conf/7005/7005.pid +logfile /usr/local/redis/conf/7005/7005.log diff --git a/codes/linux/soft/config/redis/cluster/7006/redis.conf b/codes/linux/soft/config/redis/cluster/7006/redis.conf new file mode 100644 index 00000000..6fd2635d --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7006/redis.conf @@ -0,0 +1,12 @@ +port 7006 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7006/7006.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7006 +pidfile /usr/local/redis/conf/7006/7006.pid +logfile /usr/local/redis/conf/7006/7006.log diff --git a/codes/linux/soft/config/redis/cluster/7007/redis.conf b/codes/linux/soft/config/redis/cluster/7007/redis.conf new file mode 100644 index 00000000..5cd28edc --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7007/redis.conf @@ -0,0 +1,12 @@ +port 7007 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7007/7007.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7007 +pidfile /usr/local/redis/conf/7007/7007.pid +logfile /usr/local/redis/conf/7007/7007.log diff --git a/codes/linux/soft/config/redis/cluster/7008/redis.conf b/codes/linux/soft/config/redis/cluster/7008/redis.conf new file mode 100644 index 00000000..54efbd84 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7008/redis.conf @@ -0,0 +1,12 @@ +port 7008 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7008/7008.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7008 +pidfile /usr/local/redis/conf/7008/7008.pid +logfile /usr/local/redis/conf/7008/7008.log diff --git a/codes/linux/soft/config/redis/cluster/7009/redis.conf b/codes/linux/soft/config/redis/cluster/7009/redis.conf new file mode 100644 index 00000000..41bdc4cc --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7009/redis.conf @@ -0,0 +1,12 @@ +port 7009 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7009/7009.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7009 +pidfile /usr/local/redis/conf/7009/7009.pid +logfile /usr/local/redis/conf/7009/7009.log diff --git a/codes/linux/soft/config/redis/cluster/7010/redis.conf b/codes/linux/soft/config/redis/cluster/7010/redis.conf new file mode 100644 index 00000000..b3b73f3d --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7010/redis.conf @@ -0,0 +1,12 @@ +port 7010 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7010/7010.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7010 +pidfile /usr/local/redis/conf/7010/7010.pid +logfile /usr/local/redis/conf/7010/7010.log diff --git a/codes/linux/soft/config/redis/cluster/7011/redis.conf b/codes/linux/soft/config/redis/cluster/7011/redis.conf new file mode 100644 index 00000000..ad94ad02 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7011/redis.conf @@ -0,0 +1,12 @@ +port 7011 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7011/7011.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7011 +pidfile /usr/local/redis/conf/7011/7011.pid +logfile /usr/local/redis/conf/7011/7011.log diff --git a/codes/linux/soft/config/redis/cluster/7012/redis.conf b/codes/linux/soft/config/redis/cluster/7012/redis.conf new file mode 100644 index 00000000..8b97944c --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/7012/redis.conf @@ -0,0 +1,12 @@ +port 7012 +bind 172.22.6.3 +daemonize yes + +cluster-enabled yes +cluster-config-file /usr/local/redis/conf/7012/7012.conf +cluster-node-timeout 10000 + +appendonly yes +dir /usr/local/redis/conf/7012 +pidfile /usr/local/redis/conf/7012/7012.pid +logfile /usr/local/redis/conf/7012/7012.log diff --git a/codes/linux/soft/config/redis/cluster/README.md b/codes/linux/soft/config/redis/cluster/README.md index 3d379085..f6322417 100644 --- a/codes/linux/soft/config/redis/cluster/README.md +++ b/codes/linux/soft/config/redis/cluster/README.md @@ -4,31 +4,31 @@ 集群拓扑: -- 三主六从,每个主节点有两个从节点。 -- 三哨兵,分别监听其中一个主节点。 +- 三主三从 +- 三哨兵 启动方式: -- 先执行 start-cluster.sh,会自动根据 6381 ~ 6389 目录启动服务器,并将其配置为集群。 -- 再执行 start-sentinel.sh,会根据 26381 ~ 26383 目录启动哨兵,监听集群中的三个主节点。 +- 先执行 redis-cluster.sh,会自动根据 7001 ~ 7006 目录启动服务器,并将其配置为集群。 +- 再执行 start-sentinel.sh,会根据 27001 ~ 27003 目录启动哨兵,监听集群中的三个主节点。 ## 配置 (1)集群服务器配置 redis.conf ``` -port 6381 +port 7001 bind 0.0.0.0 daemonize yes cluster-enabled yes -cluster-config-file /usr/local/redis/conf/6381/6381.conf +cluster-config-file /usr/local/redis/conf/7001/7001.conf cluster-node-timeout 10000 appendonly yes -dir /usr/local/redis/conf/6381 -pidfile /usr/local/redis/conf/6381/6381.pid -logfile /usr/local/redis/conf/6381/6381.log +dir /usr/local/redis/conf/7001 +pidfile /usr/local/redis/conf/7001/7001.pid +logfile /usr/local/redis/conf/7001/7001.log ``` 端口号、配置目录(`/usr/local/redis/conf`)根据实际情况修改。 @@ -36,18 +36,18 @@ logfile /usr/local/redis/conf/6381/6381.log (2)哨兵服务器配置 sentinel.conf ``` -port 26383 +port 27003 daemonize yes -sentinel monitor redis-master 172.22.6.3 6383 2 +sentinel monitor redis-master 172.22.6.3 7003 2 sentinel down-after-milliseconds redis-master 5000 sentinel failover-timeout redis-master 900000 sentinel parallel-syncs redis-master 1 #sentinel auth-pass redis-master 123456 -logfile /usr/local/redis/conf/26383/26383.log +logfile /usr/local/redis/conf/27003/27003.log ``` 端口号、配置目录(`/usr/local/redis/conf`)根据实际情况修改。 -最重要的配置在于:sentinel monitor redis-master 172.22.6.3 6383 2 +最重要的配置在于:sentinel monitor redis-master 172.22.6.3 7003 2 -表示监听的服务器集群名叫 redis-master,当前哨兵监听的服务器节点是:172.22.6.3:6383,这个节点如果是主节点,一旦宕机,选举新的主节点,需要至少 2 个哨兵同意。 \ No newline at end of file +表示监听的服务器集群名叫 redis-master,当前哨兵监听的服务器节点是:172.22.6.3:7003,这个节点如果是主节点,一旦宕机,选举新的主节点,需要至少 2 个哨兵同意。 diff --git a/codes/linux/soft/config/redis/cluster/create-cluster b/codes/linux/soft/config/redis/cluster/redis-cluster.sh similarity index 63% rename from codes/linux/soft/config/redis/cluster/create-cluster rename to codes/linux/soft/config/redis/cluster/redis-cluster.sh index ac133a59..07c44d74 100644 --- a/codes/linux/soft/config/redis/cluster/create-cluster +++ b/codes/linux/soft/config/redis/cluster/redis-cluster.sh @@ -1,66 +1,65 @@ -#!/bin/bash +#!/usr/bin/env bash # Settings -PORT=6380 +HOST="172.22.6.3" +PORT=7000 TIMEOUT=2000 NODES=6 REPLICAS=1 +ENDPORT=$((PORT+NODES)) # You may want to put the above config parameters into config.sh in order to # override the defaults without modifying this script. -if [ -a config.sh ] +if [[ -a config.sh ]] then source "config.sh" fi -# Computed vars -ENDPORT=$((PORT+NODES)) - -if [ "1ドル" == "start" ] +if [[ "1ドル" == "create" ]] then - while [ $((PORT < ENDPORT)) != "0" ]; do + HOSTLIST="" + while [[ $((PORT < ENDPORT)) != "0" ]]; do PORT=$((PORT+1)) - echo "Starting $PORT" - /opt/redis/src/redis-server /usr/local/redis/conf/${PORT}/redis.conf + HOSTLIST="$HOSTLIST $HOST:$PORT" done + /opt/redis/src/redis-cli --cluster create ${HOSTLIST} --cluster-replicas ${REPLICAS} exit 0 fi -if [ "1ドル" == "create" ] +if [[ "1ドル" == "start" ]] then - HOSTS="" - while [ $((PORT < ENDPORT)) != "0" ]; do + while [[ $((PORT < ENDPORT)) != "0" ]]; do PORT=$((PORT+1)) - HOSTS="$HOSTS 127.0.0.1:$PORT" + echo "Starting $PORT" + /opt/redis/src/redis-server /usr/local/redis/conf/${PORT}/redis.conf done - /opt/redis/src/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS exit 0 fi -if [ "1ドル" == "stop" ] +if [[ "1ドル" == "stop" ]] then - while [ $((PORT < ENDPORT)) != "0" ]; do + while [[ $((PORT < ENDPORT)) != "0" ]]; do PORT=$((PORT+1)) echo "Stopping $PORT" - /opt/redis/src/redis-cli -p $PORT shutdown nosave + /opt/redis/src/redis-cli -p ${PORT} shutdown nosave done exit 0 fi -if [ "1ドル" == "watch" ] +if [[ "1ドル" == "watch" ]] then PORT=$((PORT+1)) while [ 1 ]; do clear date - /opt/redis/src/redis-cli -p $PORT cluster nodes | head -30 + /opt/redis/src/redis-cli -p ${PORT} cluster nodes | head -30 sleep 1 done exit 0 fi -if [ "1ドル" == "tail" ] +if [[ "1ドル" == "tail" ]] then INSTANCE=2ドル PORT=$((PORT+INSTANCE)) @@ -68,16 +67,16 @@ then exit 0 fi -if [ "1ドル" == "call" ] +if [[ "1ドル" == "call" ]] then - while [ $((PORT < ENDPORT)) != "0" ]; do + while [[ $((PORT < ENDPORT)) != "0" ]]; do PORT=$((PORT+1)) - /opt/redis/src/redis-cli -p $PORT 2ドル 3ドル 4ドル 5ドル 6ドル 7ドル 8ドル 9ドル + /opt/redis/src/redis-cli -p ${PORT} 2ドル 3ドル 4ドル 5ドル 6ドル 7ドル 8ドル 9ドル done exit 0 fi -if [ "1ドル" == "clean" ] +if [[ "1ドル" == "clean" ]] then rm -rf *.log rm -rf appendonly*.aof @@ -86,7 +85,7 @@ then exit 0 fi -if [ "1ドル" == "clean-logs" ] +if [[ "1ドル" == "clean-logs" ]] then rm -rf *.log exit 0 diff --git a/codes/linux/soft/config/redis/cluster/redis-cluster2.sh b/codes/linux/soft/config/redis/cluster/redis-cluster2.sh new file mode 100644 index 00000000..3e3b37e3 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/redis-cluster2.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash + +# Settings +HOST="172.22.6.3" +PORT=7000 +TIMEOUT=2000 +NODES=12 +REPLICAS=1 +ENDPORT=$((PORT+NODES)) + +# You may want to put the above config parameters into config.sh in order to +# override the defaults without modifying this script. + +if [[ -a config.sh ]] +then + source "config.sh" +fi + +if [[ "1ドル" == "create" ]] +then + HOSTLIST="" + while [[ $((PORT < ENDPORT)) != "0" ]]; do + PORT=$((PORT+1)) + HOSTLIST="$HOSTLIST $HOST:$PORT" + done + /opt/redis/src/redis-cli --cluster create ${HOSTLIST} --cluster-replicas ${REPLICAS} + exit 0 +fi + +if [[ "1ドル" == "start" ]] +then + while [[ $((PORT < ENDPORT)) != "0" ]]; do + PORT=$((PORT+1)) + echo "Starting $PORT" + /opt/redis/src/redis-server /usr/local/redis/conf/${PORT}/redis.conf + done + exit 0 +fi + +if [[ "1ドル" == "stop" ]] +then + while [[ $((PORT < ENDPORT)) != "0" ]]; do + PORT=$((PORT+1)) + echo "Stopping $PORT" + /opt/redis/src/redis-cli -p ${PORT} shutdown nosave + done + exit 0 +fi + +if [[ "1ドル" == "watch" ]] +then + PORT=$((PORT+1)) + while [ 1 ]; do + clear + date + /opt/redis/src/redis-cli -p ${PORT} cluster nodes | head -30 + sleep 1 + done + exit 0 +fi + +if [[ "1ドル" == "tail" ]] +then + INSTANCE=2ドル + PORT=$((PORT+INSTANCE)) + tail -f ${PORT}.log + exit 0 +fi + +if [[ "1ドル" == "call" ]] +then + while [[ $((PORT < ENDPORT)) != "0" ]]; do + PORT=$((PORT+1)) + /opt/redis/src/redis-cli -p ${PORT} 2ドル 3ドル 4ドル 5ドル 6ドル 7ドル 8ドル 9ドル + done + exit 0 +fi + +if [[ "1ドル" == "clean" ]] +then + rm -rf *.log + rm -rf appendonly*.aof + rm -rf dump*.rdb + rm -rf nodes*.conf + exit 0 +fi + +if [[ "1ドル" == "clean-logs" ]] +then + rm -rf *.log + exit 0 +fi + +echo "Usage: 0ドル [start|create|stop|watch|tail|clean]" +echo "start -- Launch Redis Cluster instances." +echo "create -- Create a cluster using redis-cli --cluster create." +echo "stop -- Stop Redis Cluster instances." +echo "watch -- Show CLUSTER NODES output (first 30 lines) of first node." +echo "tail -- Run tail -f of instance at base port + ID." +echo "clean -- Remove all instances data, logs, configs." +echo "clean-logs -- Remove just instances logs." diff --git a/codes/linux/soft/config/redis/cluster/start-cluster.sh b/codes/linux/soft/config/redis/cluster/start-cluster.sh index 71eb01cc..c9ec4bea 100644 --- a/codes/linux/soft/config/redis/cluster/start-cluster.sh +++ b/codes/linux/soft/config/redis/cluster/start-cluster.sh @@ -1,19 +1,21 @@ -/opt/redis/src/redis-server /usr/local/redis/conf/6381/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6382/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6383/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6384/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6385/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6386/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6387/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6388/redis.conf - -/opt/redis/src/redis-server /usr/local/redis/conf/6389/redis.conf - -/opt/redis/src/redis-cli --cluster create 172.22.6.3:6381 172.22.6.3:6382 172.22.6.3:6383 172.22.6.3:6384 172.22.6.3:6385 172.22.6.3:6386 172.22.6.3:6387 172.22.6.3:6388 172.22.6.3:6389 --cluster-replicas 2 +#!/usr/bin/env bash + +PORT=6380 +NODES=6 +ENDPORT=$((PORT+NODES)) + +# 启动 4 个 redis server +while [[ $((PORT < ENDPORT)) != "0" ]]; do + PORT=$((PORT+1)) + echo "Starting $PORT" + /opt/redis/src/redis-server /usr/local/redis/conf/${PORT}/redis.conf +done + +# 创建集群模式,设置副本为 1 +# redis cluster 会自动将 4 个节点设置为 一主一从 模式,并且为两个主节点做数据分片 +/opt/redis/src/redis-cli --cluster create 172.22.6.3:6381 172.22.6.3:6382 172.22.6.3:6383 172.22.6.3:6384 172.22.6.3:6385 172.22.6.3:6386 --cluster-replicas 1 + +# 启动哨兵 +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26381/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26382/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26383/sentinel.conf diff --git a/codes/linux/soft/config/redis/cluster/start-cluster2.sh b/codes/linux/soft/config/redis/cluster/start-cluster2.sh new file mode 100644 index 00000000..54b59c96 --- /dev/null +++ b/codes/linux/soft/config/redis/cluster/start-cluster2.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# 启动 4 个 redis server +/opt/redis/src/redis-server /usr/local/redis/conf/6381/redis.conf +/opt/redis/src/redis-server /usr/local/redis/conf/6382/redis.conf +/opt/redis/src/redis-server /usr/local/redis/conf/6383/redis.conf +/opt/redis/src/redis-server /usr/local/redis/conf/6384/redis.conf +/opt/redis/src/redis-server /usr/local/redis/conf/6385/redis.conf +/opt/redis/src/redis-server /usr/local/redis/conf/6386/redis.conf + +# 创建集群模式,设置副本为 1 +# redis cluster 会自动将 4 个节点设置为 一主一从 模式,并且为两个主节点做数据分片 +/opt/redis/src/redis-cli --cluster create 172.22.6.3:6381 172.22.6.3:6382 172.22.6.3:6383 172.22.6.3:6384 172.22.6.3:6385 172.22.6.3:6386 --cluster-replicas 1 + +# 启动哨兵 +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26381/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26382/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/26383/sentinel.conf diff --git a/codes/linux/soft/config/redis/cluster/start-sentinel.sh b/codes/linux/soft/config/redis/cluster/start-sentinel.sh index 9b146735..a21c7d63 100644 --- a/codes/linux/soft/config/redis/cluster/start-sentinel.sh +++ b/codes/linux/soft/config/redis/cluster/start-sentinel.sh @@ -1,3 +1,6 @@ -/opt/redis/src/redis-sentinel /usr/local/redis/conf/26381/sentinel.conf -/opt/redis/src/redis-sentinel /usr/local/redis/conf/26382/sentinel.conf -/opt/redis/src/redis-sentinel /usr/local/redis/conf/26383/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27001/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27002/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27003/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27004/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27005/sentinel.conf +/opt/redis/src/redis-sentinel /usr/local/redis/conf/27006/sentinel.conf diff --git a/codes/linux/soft/config/redis/redis.conf b/codes/linux/soft/config/redis/redis.conf index 798b8799..90628501 100644 --- a/codes/linux/soft/config/redis/redis.conf +++ b/codes/linux/soft/config/redis/redis.conf @@ -66,7 +66,7 @@ # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES # JUST COMMENT THE FOLLOWING LINE. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -bind 0.0.0.0 +bind 172.22.6.3 # Protected mode is a layer of security protection, in order to avoid that # Redis instances left open on the internet are accessed and exploited. From 40b0db918dab69f803cce813e6dbd319d01f570a Mon Sep 17 00:00:00 2001 From: lovvvve Date: 2020年7月27日 17:32:35 +0800 Subject: [PATCH 04/20] Update ntp.md --- docs/linux/ops/ntp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linux/ops/ntp.md b/docs/linux/ops/ntp.md index f8d58dfb..9a72bdb7 100644 --- a/docs/linux/ops/ntp.md +++ b/docs/linux/ops/ntp.md @@ -148,7 +148,7 @@ $ ntpdate cn.pool.ntp.org 示例:执行如下命令,就可以在每天凌晨 3 点同步系统时间: ```shell -echo "* 3 * * * /usr/sbin/ntpdate cn.pool.ntp.org">> /etc/crontab # 修改 crond 服务配置 +echo "0 3 * * * /usr/sbin/ntpdate cn.pool.ntp.org">> /etc/crontab # 修改 crond 服务配置 systemctl restart crond # 重启 crond 服务以生效 ``` From 1458840ac89ae01f9d6b826796d8b93a97165550 Mon Sep 17 00:00:00 2001 From: dunwu Date: Thu, 1 Oct 2020 09:06:56 +0800 Subject: [PATCH 05/20] update docs --- docs/linux/soft/nexus-ops.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/linux/soft/nexus-ops.md b/docs/linux/soft/nexus-ops.md index 5346413d..73d3dffc 100644 --- a/docs/linux/soft/nexus-ops.md +++ b/docs/linux/soft/nexus-ops.md @@ -103,7 +103,7 @@ Nexus 中的仓库有以下类型: 参考配置如下: -![](http://dunwu.test.upcdn.net/snap/20200403165258.png) +![img](http://dunwu.test.upcdn.net/snap/20200403165258.png) 推荐配置的代理仓库: @@ -112,7 +112,7 @@ Nexus 中的仓库有以下类型: ### 配置 yum 仓库 -![](http://dunwu.test.upcdn.net/snap/20200403201609.png) +![img](http://dunwu.test.upcdn.net/snap/20200403201609.png) 推荐配置的 yum 代理仓库: @@ -146,7 +146,7 @@ Nexus 内置了多个定时任务,可以执行清理。 【示例】定期清理 SNAPSHOST -![](http://dunwu.test.upcdn.net/snap/20200403173030.png) +![img](http://dunwu.test.upcdn.net/snap/20200403173030.png) ## 三、开机自启动 From 326ebb2826e8dfe3d21c3036293f61158ab0ea8b Mon Sep 17 00:00:00 2001 From: dunwu Date: 2021年5月13日 17:24:59 +0800 Subject: [PATCH 06/20] =?UTF-8?q?docs:=20=E6=96=87=E6=A1=A3=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +- codes/linux/soft/fastdfs-install.sh | 6 +- docs/.vuepress/config.js | 127 ++++++++++++++++++++-------- docs/README.md | 5 +- docs/docker/docker-quickstart.md | 4 +- docs/docker/kubernetes.md | 2 +- docs/linux/cli/linux-cli-dir.md | 4 +- docs/linux/ops/crontab.md | 2 +- docs/linux/ops/samba.md | 2 +- docs/linux/ops/vim.md | 12 +-- docs/linux/soft/gitlab-ops.md | 10 +-- docs/linux/soft/jdk-install.md | 6 +- docs/linux/soft/jenkins-ops.md | 24 +++--- docs/linux/soft/nexus-ops.md | 14 +-- docs/linux/soft/svn-ops.md | 2 +- docs/linux/soft/yapi-ops.md | 12 +-- docs/package.json | 37 +++----- 17 files changed, 164 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index db9c6a26..45a0fa8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- logo + logo

@@ -13,9 +13,8 @@ > 📚 **linux-tutorial** 是一个 Linux 教程。 > -> 🔁 项目同步维护在 [github](https://github.com/dunwu/linux-tutorial) | [gitee](https://gitee.com/turnon/linux-tutorial) -> -> 📖 [电子书](https://dunwu.github.io/linux-tutorial/) | [电子书(国内)](http://turnon.gitee.io/linux-tutorial/) +> - 🔁 项目同步维护:[Github](https://github.com/dunwu/linux-tutorial/) | [Gitee](https://gitee.com/turnon/linux-tutorial/) +> - 📖 电子书阅读:[Github Pages](https://dunwu.github.io/linux-tutorial/) | [Gitee Pages](http://turnon.gitee.io/linux-tutorial/) ## 📖 内容 diff --git a/codes/linux/soft/fastdfs-install.sh b/codes/linux/soft/fastdfs-install.sh index 95cfb009..a7db9e44 100644 --- a/codes/linux/soft/fastdfs-install.sh +++ b/codes/linux/soft/fastdfs-install.sh @@ -59,7 +59,7 @@ yum install -y git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zl mkdir -p ${path} path=/opt/fdfs mkdir -p ${path}/libfastcommon -curl -o ${path}/libfastcommon.zip http://dunwu.test.upcdn.net/soft/fdfs/libfastcommon.zip +curl -o ${path}/libfastcommon.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/libfastcommon.zip if [[ ! -f ${path}/libfastcommon.zip ]]; then printf "${RED}[Error]install libfastcommon failed,exit. ${RESET}\n" exit 1 @@ -73,7 +73,7 @@ chmod +x -R ${path}/libfastcommon/*.sh printf "${GREEN}>>>>>>>>> install fastdfs${RESET}" mkdir -p ${path}/fastdfs -curl -o ${path}/fastdfs.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs.zip +curl -o ${path}/fastdfs.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs.zip if [[ ! -f ${path}/fastdfs.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs failed,exit. ${RESET}\n" fi @@ -84,7 +84,7 @@ chmod +x -R ${path}/fastdfs/*.sh printf "${GREEN}>>>>>>>>> install fastdfs-nginx-module${RESET}\n" mkdir -p ${path}/fastdfs-nginx-module -curl -o ${path}/fastdfs-nginx-module.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs-nginx-module.zip +curl -o ${path}/fastdfs-nginx-module.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs-nginx-module.zip if [[ ! -f ${path}/fastdfs-nginx-module.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs-nginx-module failed,exit. ${RESET}\n" fi diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c5f617ba..f0c20a76 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -2,44 +2,105 @@ * @see https://vuepress.vuejs.org/zh/ */ module.exports = { - port: "4000", - dest: "dist", - base: "/linux-tutorial/", - title: "LINUX-TUTORIAL", - description: "数据库教程", - head: [["link", {rel: "icon", href: `/favicon.ico`}]], + port: '4000', + dest: 'dist', + base: '/linux-tutorial/', + title: 'LINUX-TUTORIAL', + description: '数据库教程', + head: [['link', { rel: 'icon', href: `/favicon.ico` }]], markdown: { externalLinks: { - target: "_blank", rel: "noopener noreferrer" - } + target: '_blank', + rel: 'noopener noreferrer', + }, }, themeConfig: { - logo: "images/dunwu-logo-100.png", - repo: "dunwu/linux-tutorial", - repoLabel: "Github", + logo: 'images/dunwu-logo-100.png', + repo: 'dunwu/linux-tutorial', + repoLabel: 'Github', + docsDir: 'docs', + docsBranch: 'master', editLinks: true, smoothScroll: true, locales: { - "/": { - label: "简体中文", selectText: "Languages", editLinkText: "帮助我们改善此页面!", lastUpdated: "上次更新", nav: [{ - text: "Linux 命令", link: "/linux/cli/", - }, { - text: "Linux 运维", link: "/linux/ops/", - }, { - text: "Linux 软件运维", link: "/linux/soft/", - }, { - text: "Docker 教程", link: "/docker/", - }, { - text: "🎯 博客", link: "https://github.com/dunwu/blog", target: "_blank", rel: "" - }], sidebar: "auto", sidebarDepth: 2 - } - } + '/': { + label: '简体中文', + selectText: 'Languages', + editLinkText: '帮助我们改善此页面!', + lastUpdated: '上次更新', + nav: [ + { + text: 'Linux 命令', + link: '/linux/cli/', + }, + { + text: 'Linux 运维', + link: '/linux/ops/', + }, + { + text: 'Linux 软件运维', + link: '/linux/soft/', + }, + { + text: 'Docker 教程', + link: '/docker/', + }, + { + text: '🎯 博客', + link: 'https://github.com/dunwu/blog', + target: '_blank', + rel: '', + }, + ], + sidebar: 'auto', + sidebarDepth: 2, + }, + }, }, - plugins: [["@vuepress/back-to-top", true], ["@vuepress/pwa", { - serviceWorker: true, updatePopup: true - }], ["@vuepress/medium-zoom", true], ["container", { - type: "vue", before: '
', after: "
" - }], ["container", { - type: "upgrade", before: info => ``, after: "" - }], ["flowchart"]] -}; + plugins: [ + [ + '@vuepress/active-header-links', + { + sidebarLinkSelector: '.sidebar-link', + headerAnchorSelector: '.header-anchor', + }, + ], + ['@vuepress/back-to-top', true], + [ + '@vuepress/pwa', + { + serviceWorker: true, + updatePopup: true, + }, + ], + [ + '@vuepress/last-updated', + { + transformer: (timestamp, lang) => { + // 不要忘了安装 moment + const moment = require('moment') + moment.locale(lang) + return moment(timestamp).fromNow() + }, + }, + ], + ['@vuepress/medium-zoom', true], + [ + 'container', + { + type: 'vue', + before: '
',
+ after: '
', + }, + ], + [ + 'container', + { + type: 'upgrade', + before: (info) => ``, + after: '', + }, + ], + ['flowchart'], + ], +} diff --git a/docs/README.md b/docs/README.md index bb3d6492..dd36841c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,13 +1,14 @@ --- home: true -heroImage: /images/dunwu-logo-200.png +heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png heroText: LINUX-TUTORIAL tagline: 📚 linux-tutorial 是一个 Linux 教程。 actionLink: / footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu --- -# Linux 教程 +![license](https://badgen.net/github/license/dunwu/linux-tutorial) +![build](https://travis-ci.com/dunwu/linux-tutorial.svg?branch=master) > 📚 **linux-tutorial** 是一个 Linux 教程。 > diff --git a/docs/docker/docker-quickstart.md b/docs/docker/docker-quickstart.md index 6fe68340..f231afbc 100644 --- a/docs/docker/docker-quickstart.md +++ b/docs/docker/docker-quickstart.md @@ -31,7 +31,7 @@ Docker 将应用程序与该程序的依赖,打包在一个文件里面。运 - **更轻松的迁移** - 由于 `Docker` 确保了执行环境的一致性,使得应用的迁移更加容易。`Docker` 可以在很多平台上运行,无论是物理机、虚拟机、公有云、私有云,甚至是笔记本,其运行结果是一致的。因此用户可以很轻易的将在一个平台上运行的应用,迁移到另一个平台上,而不用担心运行环境的变化导致应用无法正常运行的情况。 - **更轻松的维护和扩展** - `Docker` 使用的分层存储以及镜像的技术,使得应用重复部分的复用更为容易,也使得应用的维护更新更加简单,基于基础镜像进一步扩展镜像也变得非常简单。此外,`Docker` 团队同各个开源项目团队一起维护了一大批高质量的 [官方镜像](https://hub.docker.com/search/?type=image&image_filter=official),既可以直接在生产环境使用,又可以作为基础进一步定制,大大的降低了应用服务的镜像制作成本。 -![img](http://dunwu.test.upcdn.net/cs/os/docker/containers-and-vm.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/docker/containers-and-vm.png) ### Docker 的主要用途 @@ -354,4 +354,4 @@ $ sudo systemctl start docker ## 参考资料 - [Docker 入门教程](https://www.ruanyifeng.com/blog/2018/02/docker-tutorial.html) -- [Docker — 从入门到实践](https://github.com/yeasy/docker_practice) \ No newline at end of file +- [Docker — 从入门到实践](https://github.com/yeasy/docker_practice) diff --git a/docs/docker/kubernetes.md b/docs/docker/kubernetes.md index d16b6c57..d600ea91 100644 --- a/docs/docker/kubernetes.md +++ b/docs/docker/kubernetes.md @@ -49,7 +49,7 @@ Kubernetes 主要由以下几个核心组件组成: K8S 包含若干抽象用来表示系统状态,包括:已部署的容器化应用和负载、与它们相关的网络和磁盘资源以及有关集群正在运行的其他操作的信息。 -![img](http://dunwu.test.upcdn.net/cs/os/kubernetes/pod.svg!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/kubernetes/pod.svg) - `Pod` - K8S 使用 Pod 来管理容器,每个 Pod 可以包含一个或多个紧密关联的容器。Pod 是一组紧密关联的容器集合,它们共享 PID、IPC、Network 和 UTS namespace,是 K8S 调度的基本单位。Pod 内的多个容器共享网络和文件系统,可以通过进程间通信和文件共享这种简单高效的方式组合完成服务。 - `Node` - Node 是 Pod 真正运行的主机,可以是物理机,也可以是虚拟机。为了管理 Pod,每个 Node 节点上至少要运行 container runtime(比如 docker 或者 rkt)、`kubelet` 和 `kube-proxy` 服务。 diff --git a/docs/linux/cli/linux-cli-dir.md b/docs/linux/cli/linux-cli-dir.md index c5c9ad9c..d013dad0 100644 --- a/docs/linux/cli/linux-cli-dir.md +++ b/docs/linux/cli/linux-cli-dir.md @@ -8,7 +8,7 @@ linux 目录结构是树形结构,其根目录是 `/` 。一张思维导图说明各个目录的作用: -![img](http://dunwu.test.upcdn.net/cs/os/linux/linux-folders.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/linux-folders.png) ### 1.2. Linux 文件属性 @@ -35,7 +35,7 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot 每个文件的属性由左边第一部分的 10 个字符来确定(如下图)。 -![img](http://dunwu.test.upcdn.net/snap/20180920180927171909.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920180927171909.png) 从左至右用 0-9 这些数字来表示。 diff --git a/docs/linux/ops/crontab.md b/docs/linux/ops/crontab.md index 1fd9eca3..3ce26339 100644 --- a/docs/linux/ops/crontab.md +++ b/docs/linux/ops/crontab.md @@ -65,7 +65,7 @@ crontab 要执行的定时任务都被保存在 `/etc/crontab` 文件中。 crontab 的文件格式如下: -![img](http://dunwu.test.upcdn.net/snap/20200211113339.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200211113339.png) #### 标准字段 diff --git a/docs/linux/ops/samba.md b/docs/linux/ops/samba.md index dc0e4c50..71358f9a 100644 --- a/docs/linux/ops/samba.md +++ b/docs/linux/ops/samba.md @@ -149,7 +149,7 @@ Windows: 访问:`\\<你的ip>\<你的共享路径>` : -![img](http://dunwu.test.upcdn.net/snap/20180920180928161334.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920180928161334.png) Mac: diff --git a/docs/linux/ops/vim.md b/docs/linux/ops/vim.md index 5fe92f4b..2f6d3942 100644 --- a/docs/linux/ops/vim.md +++ b/docs/linux/ops/vim.md @@ -308,33 +308,33 @@ Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错 此外,[这里](http://blog.ngedit.com/vi-vim-cheat-sheet-sch.gif)还有简体中文版。 -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/vim-cheat-sheet.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet.png) ### 3.2. 入门版 基本操作的入门版。[原版出处](https://github.com/ahrencode/Miscellaneous)还有 keynote 版本可供 DIY 以及其他相关有用的 cheatsheet。 -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/basic-vim-cheat-sheet.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/basic-vim-cheat-sheet.png) ### 3.3. 进阶版 下图是 300DPI 的超清大图,另外[查看原文](http://michael.peopleofhonoronly.com/vim/)还有更多版本:黑白,低分辨率,色盲等 -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/vim-cheat-sheet-for-programmers.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-for-programmers.png) ### 3.4. 增强版 下图是一个更新时间较新的现代版,含有的信息也更丰富。[原文链接](http://vimcheatsheet.com/) -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/vim-cheat-sheet-02.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-02.png) ### 3.5. 文字版 [原文链接](http://tnerual.eriogerg.free.fr/vimqrc.pdf) -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/vim-cheat-sheet-text-01.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-text-01.png) -![img](http://dunwu.test.upcdn.net/cs/os/linux/vim/vim-cheat-sheet-text-02.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-text-02.png) ## 4. 资料 diff --git a/docs/linux/soft/gitlab-ops.md b/docs/linux/soft/gitlab-ops.md index b90dbd35..ff942ad5 100644 --- a/docs/linux/soft/gitlab-ops.md +++ b/docs/linux/soft/gitlab-ops.md @@ -8,7 +8,7 @@ 进入官方下载地址:https://about.gitlab.com/install/ ,如下图,选择合适的版本。 -![img](http://dunwu.test.upcdn.net/snap/20190129155838.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129155838.png) 以 CentOS7 为例: @@ -70,7 +70,7 @@ docker run -d \ gitlab/gitlab-ce ``` -![img](http://dunwu.test.upcdn.net/snap/20190131150515.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150515.png) ### 自签名证书 @@ -175,7 +175,7 @@ sudo gitlab-runner register URL 和令牌信息在 Gitlab 的 Runner 管理页面获取: -![img](http://dunwu.test.upcdn.net/snap/20190129163100.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129163100.png) ``` Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) @@ -292,11 +292,11 @@ sudo gitlab-ctl restart ### 创建项目 -![img](http://dunwu.test.upcdn.net/snap/20190131150658.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150658.png) 输入项目信息,点击 Create project 按钮,在 Gitlab 创建项目。 -![img](http://dunwu.test.upcdn.net/snap/20190131150759.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150759.png) ### 克隆项目到本地 diff --git a/docs/linux/soft/jdk-install.md b/docs/linux/soft/jdk-install.md index e4477193..4eed355c 100644 --- a/docs/linux/soft/jdk-install.md +++ b/docs/linux/soft/jdk-install.md @@ -7,7 +7,7 @@ - [JDK 安装步骤](#jdk-安装步骤) - [Windows 系统安装方法](#windows-系统安装方法) - [Linux 系统安装方法](#linux-系统安装方法) - - [RedHat 发行版本使用 rpm 安装方法](#redhat-发行版本使用-rpm-安装方法) + - [RedHat 发行版本使用 rpm 安装方法](#redhat-发行版本使用-rpm-安装方法) - [参考资料](#参考资料) @@ -22,13 +22,13 @@ a. 进入 [Java 官网下载页面](https://www.oracle.com/technetwork/java/java b. 选择需要的版本: -![img](http://dunwu.test.upcdn.net/snap/20180920181010164121.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920181010164121.png) c. 选择对应操作系统的安装包: Windows 系统选择 exe 安装包;Mac 系统选择 dmp 安装包;Linux 系统选择 tar.gz 压缩包(RedHat 发行版可以安装 rpm 包)。 -![img](http://dunwu.test.upcdn.net/snap/20180920181010164308.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920181010164308.png) (2)运行安装包,按提示逐步安装 diff --git a/docs/linux/soft/jenkins-ops.md b/docs/linux/soft/jenkins-ops.md index 2495d792..6a000268 100644 --- a/docs/linux/soft/jenkins-ops.md +++ b/docs/linux/soft/jenkins-ops.md @@ -17,11 +17,11 @@ Jenkins 支持各种运行方式,可通过系统包、Docker 或者通过一 CI(Continuous integration,中文意思是持续集成)是一种软件开发时间。持续集成强调开发人员提交了新代码之后,立刻进行构建、(单元)测试。根据测试结果,我们可以确定新代码和原有代码能否正确地集成在一起。借用网络图片对 CI 加以理解。 -![img](http://dunwu.test.upcdn.net/snap/20200310174528.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310174528.png) CD(Continuous Delivery, 中文意思持续交付)是在持续集成的基础上,将集成后的代码部署到更贴近真实运行环境(类生产环境)中。比如,我们完成单元测试后,可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题,可以继续手动部署到生产环境。下图反应的是 CI/CD 的大概工作模式。 -![img](http://dunwu.test.upcdn.net/snap/20200310174544.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310174544.png) ## Jenkins 安装 @@ -98,7 +98,7 @@ Jenkins 是一个强大的 CI 工具,虽然本身使用 Java 开发,但也 General 是构建任务的一些基本配置。名称,描述之类的。 -![img](http://dunwu.test.upcdn.net/snap/20200310221814.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310221814.png) 重要配置项: @@ -111,7 +111,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Source Code Management**,即源码管理,就是配置你代码的存放位置。 -![img](http://dunwu.test.upcdn.net/snap/20200310222110.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310222110.png) - **Git:** 支持主流的 Github 和 Gitlab 代码仓库。因我们的研发团队使用的是 gitlab,所以下面我只会对该项进行介绍。 - **Repository URL**:仓库地址。 @@ -124,7 +124,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Triggers**,即构建触发器,用于构建任务的触发器。 -![img](http://dunwu.test.upcdn.net/snap/20200310222608.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310222608.png) 配置说明: @@ -138,7 +138,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Environment**,即构建环境,配置构建前的一些准备工作,如指定构建工具。 -![img](http://dunwu.test.upcdn.net/snap/20200310223004.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310223004.png) ### Build @@ -146,7 +146,7 @@ Build,即构建。 点击下图中的 Add build step 按钮,会弹出一个构建任务菜单,可以根据实际需要来选择。 -![img](http://dunwu.test.upcdn.net/snap/20200310223241.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310223241.png) 【说明】 @@ -162,11 +162,11 @@ Build,即构建。 **Post-build Actions**,即构建后操作,用于构建完本项目的一些后续操作,比如生成相应的代码测试报告。 -![img](http://dunwu.test.upcdn.net/snap/20200310224106.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224106.png) -![img](http://dunwu.test.upcdn.net/snap/20200310224254.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224254.png) -![img](http://dunwu.test.upcdn.net/snap/20200310224331.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224331.png) 个人较常用的配置: @@ -182,13 +182,13 @@ Build,即构建。 ### 开始构建 -![img](http://dunwu.test.upcdn.net/snap/20200310224927.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224927.png) 如上图所示,一切配置好后,即可点击 **Build Now** 开始构建。 ### 构建结果 -![img](http://dunwu.test.upcdn.net/snap/20200310225234.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310225234.png) - **构建状态** - **Successful 蓝色**:构建完成,并且被认为是稳定的。 diff --git a/docs/linux/soft/nexus-ops.md b/docs/linux/soft/nexus-ops.md index 73d3dffc..4f9df168 100644 --- a/docs/linux/soft/nexus-ops.md +++ b/docs/linux/soft/nexus-ops.md @@ -14,7 +14,7 @@ 进入[官方下载地址](https://www.sonatype.com/download-oss-sonatype),选择合适版本下载。 -![img](http://dunwu.test.upcdn.net/snap/20181127203029.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203029.png) 本人将 Nexus 部署在 Linux 机器,所以选用的是 Unix 版本。 @@ -69,7 +69,7 @@ Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload} Nexus 的默认启动端口为 `8081`,启动成功后,在浏览器中访问 `http://:8081`,欢迎页面如下图所示: -![img](http://dunwu.test.upcdn.net/snap/20181127203131.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203131.png) 点击右上角 Sign in 登录,默认用户名/密码为:`admin/admin123`。 @@ -82,7 +82,7 @@ Nexus 中的仓库有以下类型: - `virtual` - 虚拟仓库。用于适配 Maven 1; - `group` - 仓库组。Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。 -![img](http://dunwu.test.upcdn.net/cs/java/javalib/maven/nexus.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/java/javalib/maven/nexus.png) 建议配置如下: @@ -95,7 +95,7 @@ Nexus 中的仓库有以下类型: - **group 仓库** - **maven-public** - 私有仓库的公共空间,把上面三个仓库组合在一起对外提供服务,在本地 maven 基础配置 settings.xml 中使用。 -![img](http://dunwu.test.upcdn.net/snap/20181127203156.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203156.png) > 其中: > @@ -103,7 +103,7 @@ Nexus 中的仓库有以下类型: 参考配置如下: -![img](http://dunwu.test.upcdn.net/snap/20200403165258.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403165258.png) 推荐配置的代理仓库: @@ -112,7 +112,7 @@ Nexus 中的仓库有以下类型: ### 配置 yum 仓库 -![img](http://dunwu.test.upcdn.net/snap/20200403201609.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403201609.png) 推荐配置的 yum 代理仓库: @@ -146,7 +146,7 @@ Nexus 内置了多个定时任务,可以执行清理。 【示例】定期清理 SNAPSHOST -![img](http://dunwu.test.upcdn.net/snap/20200403173030.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403173030.png) ## 三、开机自启动 diff --git a/docs/linux/soft/svn-ops.md b/docs/linux/soft/svn-ops.md index 31ebbc15..4f66396a 100644 --- a/docs/linux/soft/svn-ops.md +++ b/docs/linux/soft/svn-ops.md @@ -141,7 +141,7 @@ $ vi /etc/sysconfig/svnserve 在新的窗口,输入地址 `svn://<你的 IP>` 即可,不出意外输入用户名和密码就能连接成功了(这里的用户、密码必须在 passwd 配置文件的清单中)。默认端口 3690,如果你修改了端口,那么要记得加上端口号。如下图所示: -![img](http://dunwu.test.upcdn.net/snap/20190129175443.png) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129175443.png) ## 参考资料 diff --git a/docs/linux/soft/yapi-ops.md b/docs/linux/soft/yapi-ops.md index 13802443..95e6b20b 100644 --- a/docs/linux/soft/yapi-ops.md +++ b/docs/linux/soft/yapi-ops.md @@ -4,17 +4,17 @@ > > 本文目的在于记录 svn 的安装、配置、使用。 -![img](http://dunwu.test.upcdn.net/snap/1562814562978.png!zp) +![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1562814562978.png) - [1. 普通部署](#1-普通部署) - - [1.1. 环境要求](#11-环境要求) - - [1.2. 部署](#12-部署) - - [1.3. 升级](#13-升级) + - [1.1. 环境要求](#11-环境要求) + - [1.2. 部署](#12-部署) + - [1.3. 升级](#13-升级) - [2. Docker 部署](#2-docker-部署) - - [2.1. 环境要求](#21-环境要求) - - [2.2. 部署](#22-部署) + - [2.1. 环境要求](#21-环境要求) + - [2.2. 部署](#22-部署) - [3. 参考资料](#3-参考资料) diff --git a/docs/package.json b/docs/package.json index ade50f7a..cfccfcb4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,35 +5,26 @@ "scripts": { "clean": "rimraf dist && rimraf .temp", "build": "npm run clean && vuepress build ./ --temp .temp", - "dev": "vuepress dev ./ --temp .temp", - "lint-md": "npm run lint-md:style && npm run lint-md:wording", - "lint-md:style": "remark --quiet --frail .", - "lint-md:wording": "textlint ./**/*.md", + "start": "vuepress dev ./ --temp .temp", + "lint": "markdownlint -r markdownlint-rule-emphasis-style -c ./.markdownlint.json **/*.md -i node_modules", + "lint:fix": "markdownlint -f -r markdownlint-rule-emphasis-style -c ./.markdownlint.json **/*.md -i node_modules", "show-help": "vuepress --help", "view-info": "vuepress view-info ./ --temp .temp" }, "devDependencies": { - "@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.7", - "@vuepress/plugin-back-to-top": "^1.3.0", - "@vuepress/plugin-medium-zoom": "^1.3.0", - "@vuepress/plugin-pwa": "^1.3.0", - "@vuepress/theme-vue": "^1.3.0", - "remark-cli": "^7.0.0", - "remark-lint": "^6.0.5", - "remark-preset-lint-consistent": "^2.0.3", - "remark-preset-lint-recommended": "^3.0.3", + "@vuepress/plugin-active-header-links": "^1.8.2", + "@vuepress/plugin-back-to-top": "^1.8.2", + "@vuepress/plugin-medium-zoom": "^1.8.2", + "@vuepress/plugin-pwa": "^1.8.2", + "@vuepress/theme-vue": "^1.8.2", + "markdownlint-cli": "^0.25.0", + "markdownlint-rule-emphasis-style": "^1.0.1", "rimraf": "^3.0.1", - "textlint": "^11.3.1", - "textlint-filter-rule-comments": "^1.2.2", - "textlint-rule-apostrophe": "^1.0.0", - "textlint-rule-common-misspellings": "^1.0.1", - "textlint-rule-diacritics": "^1.0.0", - "textlint-rule-en-capitalization": "^2.0.2", - "textlint-rule-stop-words": "^1.0.17", - "textlint-rule-terminology": "^1.1.30", - "textlint-rule-write-good": "^1.6.2", "vue-toasted": "^1.1.25", - "vuepress": "^1.3.0", + "vuepress": "^1.8.2", "vuepress-plugin-flowchart": "^1.4.2" + }, + "dependencies": { + "moment": "^2.29.1" } } From 6ab8b8753cb1f60a1a0d118f978699760b36747d Mon Sep 17 00:00:00 2001 From: dunwu Date: Wed, 6 Apr 2022 20:29:31 +0800 Subject: [PATCH 07/20] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f7498fb..47463f91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: node_js sudo: required -node_js: stable +node_js: '16.13.0' branches: only: From 4c8a52e0dd823e00958d1eee26fce8bf0bd5b6b0 Mon Sep 17 00:00:00 2001 From: dunwu Date: 2022年6月28日 10:24:33 +0800 Subject: [PATCH 08/20] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- docs/README.md | 4 ++-- docs/docker/README.md | 2 +- docs/linux/cli/README.md | 4 ++-- docs/linux/ops/README.md | 2 +- docs/linux/soft/README.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 45a0fa8c..7f6cbfa7 100644 --- a/README.md +++ b/README.md @@ -154,4 +154,4 @@ ## 🚪 传送门 -◾ 🏠 [LINUX-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ diff --git a/docs/README.md b/docs/README.md index dd36841c..9e199165 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png +heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo.png heroText: LINUX-TUTORIAL tagline: 📚 linux-tutorial 是一个 Linux 教程。 actionLink: / @@ -154,4 +154,4 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu ## 🚪 传送门 -◾ 🏠 [LINUX-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ diff --git a/docs/docker/README.md b/docs/docker/README.md index c77d748a..8653d515 100644 --- a/docs/docker/README.md +++ b/docs/docker/README.md @@ -33,4 +33,4 @@ ## 🚪 传送门 -◾ 🏠 [DB-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ diff --git a/docs/linux/cli/README.md b/docs/linux/cli/README.md index 4c455df3..53a28666 100644 --- a/docs/linux/cli/README.md +++ b/docs/linux/cli/README.md @@ -12,7 +12,7 @@ - [Linux 系统管理](linux-cli-system.md) - 关键词:`reboot`, `exit`, `shutdown`, `date`, `mount`, `umount`, `ps`, `kill`, `systemctl`, `service`, `crontab` - [Linux 网络管理](linux-cli-net.md) - 关键词:关键词:`curl`, `wget`, `telnet`, `ip`, `hostname`, `ifconfig`, `route`, `ssh`, `ssh-keygen`, `firewalld`, `iptables`, `host`, `nslookup`, `nc`/`netcat`, `ping`, `traceroute`, `netstat` - [Linux 硬件管理](linux-cli-hardware.md) - 关键词:`df`, `du`, `top`, `free`, `iotop` -- [Linux 软件管理](linux-cli-hardware.md) - 关键词:`rpm`, `yum`, `apt-get` +- [Linux 软件管理](linux-cli-software.md) - 关键词:`rpm`, `yum`, `apt-get` ## 📚 资料 @@ -22,4 +22,4 @@ ## 🚪 传送门 -◾ 🏠 [DB-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ diff --git a/docs/linux/ops/README.md b/docs/linux/ops/README.md index f9b0f0f9..658882f6 100644 --- a/docs/linux/ops/README.md +++ b/docs/linux/ops/README.md @@ -14,4 +14,4 @@ ## 🚪 传送门 -◾ 🏠 [DB-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ diff --git a/docs/linux/soft/README.md b/docs/linux/soft/README.md index 7355bd46..b0df7bea 100644 --- a/docs/linux/soft/README.md +++ b/docs/linux/soft/README.md @@ -28,4 +28,4 @@ ## 🚪 传送门 -◾ 🏠 [DB-TUTORIAL 首页](https://github.com/dunwu/linux-tutorial) ◾ 🎯 [我的博客](https://github.com/dunwu/blog) ◾ +◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾ From 64e3b95398518eb8923ae67072a9a87c5669dfc1 Mon Sep 17 00:00:00 2001 From: dunwu Date: Thu, 9 Feb 2023 21:19:59 +0800 Subject: [PATCH 09/20] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- docs/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7f6cbfa7..46655f2e 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ ### 其他 -- [一篇文章让你彻底掌握 Python](https://github.com/dunwu/blog/blob/master/source/_posts/coding/python.md) -- [一篇文章让你彻底掌握 Shell](https://github.com/dunwu/blog/blob/master/source/_posts/coding/shell.md) -- [Git 从入门到精通](https://github.com/dunwu/blog/blob/master/source/_posts/tools/git.md) +- [一篇文章让你彻底掌握 Python](https://dunwu.github.io/blog/pages/ef501b/) +- [一篇文章让你彻底掌握 Shell](https://dunwu.github.io/blog/pages/ea6ae1/) +- [如何优雅的玩转 Git](https://dunwu.github.io/blog/pages/2fc8b1/) ## ⌨ 脚本 diff --git a/docs/README.md b/docs/README.md index 9e199165..2d5f349d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -84,9 +84,9 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu ### 其他 -- [一篇文章让你彻底掌握 Python](https://github.com/dunwu/blog/blob/master/source/_posts/coding/python.md) -- [一篇文章让你彻底掌握 Shell](https://github.com/dunwu/blog/blob/master/source/_posts/coding/shell.md) -- [Git 从入门到精通](https://github.com/dunwu/blog/blob/master/source/_posts/tools/git.md) +- [一篇文章让你彻底掌握 Python](https://dunwu.github.io/blog/pages/ef501b/) +- [一篇文章让你彻底掌握 Shell](https://dunwu.github.io/blog/pages/ea6ae1/) +- [如何优雅的玩转 Git](https://dunwu.github.io/blog/pages/2fc8b1/) ## ⌨ 脚本 From 506d864e4bd5b76b67b155bc29e5483e85bd661b Mon Sep 17 00:00:00 2001 From: 123456 Date: 2023年3月31日 20:58:41 +0800 Subject: [PATCH 10/20] plus --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 46655f2e..64679b5b 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ - [东北大学](http://mirror.neu.edu.cn/) - [浙江大学](http://mirrors.zju.edu.cn/) - [东软信息学院](http://mirrors.neusoft.edu.cn/) + - [校园网联合镜像站](https://mirrors.cernet.edu.cn) ## 🚪 传送门 From e966ae7e3595c8afa168b9d76602c6371d5f8497 Mon Sep 17 00:00:00 2001 From: kid1412621 Date: 2023年8月28日 10:28:15 +0800 Subject: [PATCH 11/20] Update linux-cli-system.md fix typo --- docs/linux/cli/linux-cli-system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linux/cli/linux-cli-system.md b/docs/linux/cli/linux-cli-system.md index 5a1b4ea2..703a5905 100644 --- a/docs/linux/cli/linux-cli-system.md +++ b/docs/linux/cli/linux-cli-system.md @@ -276,7 +276,7 @@ systemctl status nfs-server.service systemctl restart nfs-server.service # 6.查看所有已启动的服务 -systemctl list -units --type=service +systemctl list-units --type=service # 7. 开启防火墙 22 端口 iptables -I INPUT -p tcp --dport 22 -j accept From f25d28fd1dc7c19d34dd1739733be6e717b170fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9D=E6=82=9F?= Date: Mon, 4 Sep 2023 09:22:08 +0800 Subject: [PATCH 12/20] Update crontab.md --- docs/linux/ops/crontab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/linux/ops/crontab.md b/docs/linux/ops/crontab.md index 3ce26339..8713136b 100644 --- a/docs/linux/ops/crontab.md +++ b/docs/linux/ops/crontab.md @@ -170,7 +170,7 @@ MAILTO=root #### 实例 11:每一小时重启 smb ```shell -* */1 * * * /etc/init.d/smb restart +0 * * * * /etc/init.d/smb restart ``` #### 实例 12:晚上 11 点到早上 7 点之间,每隔一小时重启 smb From 13ab6a64428bfd9b959300fc8c3582f056cd39d9 Mon Sep 17 00:00:00 2001 From: dunwu Date: 2024年1月27日 23:10:11 +0800 Subject: [PATCH 13/20] =?UTF-8?q?feat:=20=E6=95=B4=E7=90=86=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- codes/linux/soft/fastdfs-install.sh | 6 +++--- docs/README.md | 2 +- docs/docker/docker-quickstart.md | 2 +- docs/docker/kubernetes.md | 2 +- docs/linux/cli/linux-cli-dir.md | 4 ++-- docs/linux/ops/crontab.md | 2 +- docs/linux/ops/samba.md | 2 +- docs/linux/ops/vim.md | 12 ++++++------ docs/linux/soft/gitlab-ops.md | 10 +++++----- docs/linux/soft/jdk-install.md | 4 ++-- docs/linux/soft/jenkins-ops.md | 24 ++++++++++++------------ docs/linux/soft/nexus-ops.md | 14 +++++++------- docs/linux/soft/svn-ops.md | 2 +- docs/linux/soft/yapi-ops.md | 2 +- 15 files changed, 45 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 64679b5b..328d4182 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- logo + logo

diff --git a/codes/linux/soft/fastdfs-install.sh b/codes/linux/soft/fastdfs-install.sh index a7db9e44..95cfb009 100644 --- a/codes/linux/soft/fastdfs-install.sh +++ b/codes/linux/soft/fastdfs-install.sh @@ -59,7 +59,7 @@ yum install -y git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zl mkdir -p ${path} path=/opt/fdfs mkdir -p ${path}/libfastcommon -curl -o ${path}/libfastcommon.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/libfastcommon.zip +curl -o ${path}/libfastcommon.zip http://dunwu.test.upcdn.net/soft/fdfs/libfastcommon.zip if [[ ! -f ${path}/libfastcommon.zip ]]; then printf "${RED}[Error]install libfastcommon failed,exit. ${RESET}\n" exit 1 @@ -73,7 +73,7 @@ chmod +x -R ${path}/libfastcommon/*.sh printf "${GREEN}>>>>>>>>> install fastdfs${RESET}" mkdir -p ${path}/fastdfs -curl -o ${path}/fastdfs.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs.zip +curl -o ${path}/fastdfs.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs.zip if [[ ! -f ${path}/fastdfs.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs failed,exit. ${RESET}\n" fi @@ -84,7 +84,7 @@ chmod +x -R ${path}/fastdfs/*.sh printf "${GREEN}>>>>>>>>> install fastdfs-nginx-module${RESET}\n" mkdir -p ${path}/fastdfs-nginx-module -curl -o ${path}/fastdfs-nginx-module.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs-nginx-module.zip +curl -o ${path}/fastdfs-nginx-module.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs-nginx-module.zip if [[ ! -f ${path}/fastdfs-nginx-module.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs-nginx-module failed,exit. ${RESET}\n" fi diff --git a/docs/README.md b/docs/README.md index 2d5f349d..8cf2000b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo.png +heroImage: https://raw.githubusercontent.com/dunwu/images/master/common/dunwu-logo.png heroText: LINUX-TUTORIAL tagline: 📚 linux-tutorial 是一个 Linux 教程。 actionLink: / diff --git a/docs/docker/docker-quickstart.md b/docs/docker/docker-quickstart.md index f231afbc..4c5434fb 100644 --- a/docs/docker/docker-quickstart.md +++ b/docs/docker/docker-quickstart.md @@ -31,7 +31,7 @@ Docker 将应用程序与该程序的依赖,打包在一个文件里面。运 - **更轻松的迁移** - 由于 `Docker` 确保了执行环境的一致性,使得应用的迁移更加容易。`Docker` 可以在很多平台上运行,无论是物理机、虚拟机、公有云、私有云,甚至是笔记本,其运行结果是一致的。因此用户可以很轻易的将在一个平台上运行的应用,迁移到另一个平台上,而不用担心运行环境的变化导致应用无法正常运行的情况。 - **更轻松的维护和扩展** - `Docker` 使用的分层存储以及镜像的技术,使得应用重复部分的复用更为容易,也使得应用的维护更新更加简单,基于基础镜像进一步扩展镜像也变得非常简单。此外,`Docker` 团队同各个开源项目团队一起维护了一大批高质量的 [官方镜像](https://hub.docker.com/search/?type=image&image_filter=official),既可以直接在生产环境使用,又可以作为基础进一步定制,大大的降低了应用服务的镜像制作成本。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/docker/containers-and-vm.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/docker/containers-and-vm.png) ### Docker 的主要用途 diff --git a/docs/docker/kubernetes.md b/docs/docker/kubernetes.md index d600ea91..82daee1c 100644 --- a/docs/docker/kubernetes.md +++ b/docs/docker/kubernetes.md @@ -49,7 +49,7 @@ Kubernetes 主要由以下几个核心组件组成: K8S 包含若干抽象用来表示系统状态,包括:已部署的容器化应用和负载、与它们相关的网络和磁盘资源以及有关集群正在运行的其他操作的信息。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/kubernetes/pod.svg) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/kubernetes/pod.svg) - `Pod` - K8S 使用 Pod 来管理容器,每个 Pod 可以包含一个或多个紧密关联的容器。Pod 是一组紧密关联的容器集合,它们共享 PID、IPC、Network 和 UTS namespace,是 K8S 调度的基本单位。Pod 内的多个容器共享网络和文件系统,可以通过进程间通信和文件共享这种简单高效的方式组合完成服务。 - `Node` - Node 是 Pod 真正运行的主机,可以是物理机,也可以是虚拟机。为了管理 Pod,每个 Node 节点上至少要运行 container runtime(比如 docker 或者 rkt)、`kubelet` 和 `kube-proxy` 服务。 diff --git a/docs/linux/cli/linux-cli-dir.md b/docs/linux/cli/linux-cli-dir.md index d013dad0..891234f8 100644 --- a/docs/linux/cli/linux-cli-dir.md +++ b/docs/linux/cli/linux-cli-dir.md @@ -8,7 +8,7 @@ linux 目录结构是树形结构,其根目录是 `/` 。一张思维导图说明各个目录的作用: -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/linux-folders.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/linux-folders.png) ### 1.2. Linux 文件属性 @@ -35,7 +35,7 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot 每个文件的属性由左边第一部分的 10 个字符来确定(如下图)。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920180927171909.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20180920180927171909.png) 从左至右用 0-9 这些数字来表示。 diff --git a/docs/linux/ops/crontab.md b/docs/linux/ops/crontab.md index 8713136b..25d27650 100644 --- a/docs/linux/ops/crontab.md +++ b/docs/linux/ops/crontab.md @@ -65,7 +65,7 @@ crontab 要执行的定时任务都被保存在 `/etc/crontab` 文件中。 crontab 的文件格式如下: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200211113339.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200211113339.png) #### 标准字段 diff --git a/docs/linux/ops/samba.md b/docs/linux/ops/samba.md index 71358f9a..19fe6d9f 100644 --- a/docs/linux/ops/samba.md +++ b/docs/linux/ops/samba.md @@ -149,7 +149,7 @@ Windows: 访问:`\\<你的ip>\<你的共享路径>` : -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920180928161334.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20180920180928161334.png) Mac: diff --git a/docs/linux/ops/vim.md b/docs/linux/ops/vim.md index 2f6d3942..ece7522d 100644 --- a/docs/linux/ops/vim.md +++ b/docs/linux/ops/vim.md @@ -308,33 +308,33 @@ Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错 此外,[这里](http://blog.ngedit.com/vi-vim-cheat-sheet-sch.gif)还有简体中文版。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/vim-cheat-sheet.png) ### 3.2. 入门版 基本操作的入门版。[原版出处](https://github.com/ahrencode/Miscellaneous)还有 keynote 版本可供 DIY 以及其他相关有用的 cheatsheet。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/basic-vim-cheat-sheet.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/basic-vim-cheat-sheet.png) ### 3.3. 进阶版 下图是 300DPI 的超清大图,另外[查看原文](http://michael.peopleofhonoronly.com/vim/)还有更多版本:黑白,低分辨率,色盲等 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-for-programmers.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/vim-cheat-sheet-for-programmers.png) ### 3.4. 增强版 下图是一个更新时间较新的现代版,含有的信息也更丰富。[原文链接](http://vimcheatsheet.com/) -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-02.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/vim-cheat-sheet-02.png) ### 3.5. 文字版 [原文链接](http://tnerual.eriogerg.free.fr/vimqrc.pdf) -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-text-01.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/vim-cheat-sheet-text-01.png) -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/os/linux/vim/vim-cheat-sheet-text-02.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/os/linux/vim/vim-cheat-sheet-text-02.png) ## 4. 资料 diff --git a/docs/linux/soft/gitlab-ops.md b/docs/linux/soft/gitlab-ops.md index ff942ad5..3d5e564f 100644 --- a/docs/linux/soft/gitlab-ops.md +++ b/docs/linux/soft/gitlab-ops.md @@ -8,7 +8,7 @@ 进入官方下载地址:https://about.gitlab.com/install/ ,如下图,选择合适的版本。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129155838.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190129155838.png) 以 CentOS7 为例: @@ -70,7 +70,7 @@ docker run -d \ gitlab/gitlab-ce ``` -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150515.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190131150515.png) ### 自签名证书 @@ -175,7 +175,7 @@ sudo gitlab-runner register URL 和令牌信息在 Gitlab 的 Runner 管理页面获取: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129163100.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190129163100.png) ``` Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) @@ -292,11 +292,11 @@ sudo gitlab-ctl restart ### 创建项目 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150658.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190131150658.png) 输入项目信息,点击 Create project 按钮,在 Gitlab 创建项目。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190131150759.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190131150759.png) ### 克隆项目到本地 diff --git a/docs/linux/soft/jdk-install.md b/docs/linux/soft/jdk-install.md index 4eed355c..6c29acb4 100644 --- a/docs/linux/soft/jdk-install.md +++ b/docs/linux/soft/jdk-install.md @@ -22,13 +22,13 @@ a. 进入 [Java 官网下载页面](https://www.oracle.com/technetwork/java/java b. 选择需要的版本: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920181010164121.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20180920181010164121.png) c. 选择对应操作系统的安装包: Windows 系统选择 exe 安装包;Mac 系统选择 dmp 安装包;Linux 系统选择 tar.gz 压缩包(RedHat 发行版可以安装 rpm 包)。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20180920181010164308.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20180920181010164308.png) (2)运行安装包,按提示逐步安装 diff --git a/docs/linux/soft/jenkins-ops.md b/docs/linux/soft/jenkins-ops.md index 6a000268..3ed2e485 100644 --- a/docs/linux/soft/jenkins-ops.md +++ b/docs/linux/soft/jenkins-ops.md @@ -17,11 +17,11 @@ Jenkins 支持各种运行方式,可通过系统包、Docker 或者通过一 CI(Continuous integration,中文意思是持续集成)是一种软件开发时间。持续集成强调开发人员提交了新代码之后,立刻进行构建、(单元)测试。根据测试结果,我们可以确定新代码和原有代码能否正确地集成在一起。借用网络图片对 CI 加以理解。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310174528.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310174528.png) CD(Continuous Delivery, 中文意思持续交付)是在持续集成的基础上,将集成后的代码部署到更贴近真实运行环境(类生产环境)中。比如,我们完成单元测试后,可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题,可以继续手动部署到生产环境。下图反应的是 CI/CD 的大概工作模式。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310174544.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310174544.png) ## Jenkins 安装 @@ -98,7 +98,7 @@ Jenkins 是一个强大的 CI 工具,虽然本身使用 Java 开发,但也 General 是构建任务的一些基本配置。名称,描述之类的。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310221814.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310221814.png) 重要配置项: @@ -111,7 +111,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Source Code Management**,即源码管理,就是配置你代码的存放位置。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310222110.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310222110.png) - **Git:** 支持主流的 Github 和 Gitlab 代码仓库。因我们的研发团队使用的是 gitlab,所以下面我只会对该项进行介绍。 - **Repository URL**:仓库地址。 @@ -124,7 +124,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Triggers**,即构建触发器,用于构建任务的触发器。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310222608.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310222608.png) 配置说明: @@ -138,7 +138,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Environment**,即构建环境,配置构建前的一些准备工作,如指定构建工具。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310223004.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310223004.png) ### Build @@ -146,7 +146,7 @@ Build,即构建。 点击下图中的 Add build step 按钮,会弹出一个构建任务菜单,可以根据实际需要来选择。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310223241.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310223241.png) 【说明】 @@ -162,11 +162,11 @@ Build,即构建。 **Post-build Actions**,即构建后操作,用于构建完本项目的一些后续操作,比如生成相应的代码测试报告。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224106.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310224106.png) -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224254.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310224254.png) -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224331.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310224331.png) 个人较常用的配置: @@ -182,13 +182,13 @@ Build,即构建。 ### 开始构建 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310224927.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310224927.png) 如上图所示,一切配置好后,即可点击 **Build Now** 开始构建。 ### 构建结果 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200310225234.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200310225234.png) - **构建状态** - **Successful 蓝色**:构建完成,并且被认为是稳定的。 diff --git a/docs/linux/soft/nexus-ops.md b/docs/linux/soft/nexus-ops.md index 4f9df168..c68af2ab 100644 --- a/docs/linux/soft/nexus-ops.md +++ b/docs/linux/soft/nexus-ops.md @@ -14,7 +14,7 @@ 进入[官方下载地址](https://www.sonatype.com/download-oss-sonatype),选择合适版本下载。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203029.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20181127203029.png) 本人将 Nexus 部署在 Linux 机器,所以选用的是 Unix 版本。 @@ -69,7 +69,7 @@ Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload} Nexus 的默认启动端口为 `8081`,启动成功后,在浏览器中访问 `http://:8081`,欢迎页面如下图所示: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203131.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20181127203131.png) 点击右上角 Sign in 登录,默认用户名/密码为:`admin/admin123`。 @@ -82,7 +82,7 @@ Nexus 中的仓库有以下类型: - `virtual` - 虚拟仓库。用于适配 Maven 1; - `group` - 仓库组。Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/cs/java/javalib/maven/nexus.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/cs/java/javalib/maven/nexus.png) 建议配置如下: @@ -95,7 +95,7 @@ Nexus 中的仓库有以下类型: - **group 仓库** - **maven-public** - 私有仓库的公共空间,把上面三个仓库组合在一起对外提供服务,在本地 maven 基础配置 settings.xml 中使用。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203156.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20181127203156.png) > 其中: > @@ -103,7 +103,7 @@ Nexus 中的仓库有以下类型: 参考配置如下: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403165258.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200403165258.png) 推荐配置的代理仓库: @@ -112,7 +112,7 @@ Nexus 中的仓库有以下类型: ### 配置 yum 仓库 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403201609.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200403201609.png) 推荐配置的 yum 代理仓库: @@ -146,7 +146,7 @@ Nexus 内置了多个定时任务,可以执行清理。 【示例】定期清理 SNAPSHOST -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200403173030.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200403173030.png) ## 三、开机自启动 diff --git a/docs/linux/soft/svn-ops.md b/docs/linux/soft/svn-ops.md index 4f66396a..3e27a4b5 100644 --- a/docs/linux/soft/svn-ops.md +++ b/docs/linux/soft/svn-ops.md @@ -141,7 +141,7 @@ $ vi /etc/sysconfig/svnserve 在新的窗口,输入地址 `svn://<你的 IP>` 即可,不出意外输入用户名和密码就能连接成功了(这里的用户、密码必须在 passwd 配置文件的清单中)。默认端口 3690,如果你修改了端口,那么要记得加上端口号。如下图所示: -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20190129175443.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20190129175443.png) ## 参考资料 diff --git a/docs/linux/soft/yapi-ops.md b/docs/linux/soft/yapi-ops.md index 95e6b20b..938cf73f 100644 --- a/docs/linux/soft/yapi-ops.md +++ b/docs/linux/soft/yapi-ops.md @@ -4,7 +4,7 @@ > > 本文目的在于记录 svn 的安装、配置、使用。 -![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1562814562978.png) +![img](https://raw.githubusercontent.com/dunwu/images/master/snap/1562814562978.png) From 879ef3bf08b1638a7d6f36c2de32726f81552df8 Mon Sep 17 00:00:00 2001 From: ratio Date: 2024年2月26日 22:56:56 +0800 Subject: [PATCH 14/20] Update linux-cli-dir.md --- docs/linux/cli/linux-cli-dir.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/linux/cli/linux-cli-dir.md b/docs/linux/cli/linux-cli-dir.md index 891234f8..5bdd9f1b 100644 --- a/docs/linux/cli/linux-cli-dir.md +++ b/docs/linux/cli/linux-cli-dir.md @@ -18,7 +18,7 @@ Linux 系统是一种典型的多用户系统,不同的用户处于不同的 ```bash $ ls -l total 64 -dr-xr-xr-x 2 root root 4096 Dec 14 2012 bin +drwxr-xr-x 2 root root 4096 Dec 14 2012 bin dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot ``` @@ -52,7 +52,7 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot ```bash $ ls -l total 64 -dr-xr-xr-x 2 root root 4096 Dec 14 2012 bin +drwxr-xr-x 2 root root 4096 Dec 14 2012 bin dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot ``` From 8f89d2ba22e65014acea0232afad4f9d9e25cc20 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: 2024年3月12日 18:34:04 +0800 Subject: [PATCH 15/20] Add pnpm lockfile to .gitignore --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 83948575..e3e2b4c2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ hs_err_pid* # maven plugin temp files .flattened-pom.xml package-lock.json - +pnpm-lock.yaml # ------------------------------- javascript ------------------------------- # dependencies @@ -50,12 +50,10 @@ yarn-error.log* bundle*.js book.pdf - # ------------------------------- intellij ------------------------------- .idea *.iml - # ------------------------------- eclipse ------------------------------- .classpath .project From d66d86d85ccde3d66b47379b45d1523e7d593db3 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: 2024年3月12日 18:36:58 +0800 Subject: [PATCH 16/20] =?UTF-8?q?fix:=20Docker=E6=95=99=E7=A8=8B=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2`=F0=9F=93=96=E5=86=85=E5=AE=B9`=20=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docker/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docker/README.md b/docs/docker/README.md index 8653d515..7434bbcb 100644 --- a/docs/docker/README.md +++ b/docs/docker/README.md @@ -2,10 +2,10 @@ ## 📖 内容 -- [Docker 快速入门](docker/docker-quickstart.md) -- [Dockerfile 最佳实践](docker/docker-dockerfile.md) -- [Docker Cheat Sheet](docker/docker-cheat-sheet.md) -- [Kubernetes 应用指南](docker/kubernetes.md) +- [Docker 快速入门](docker-quickstart.md) +- [Dockerfile 最佳实践](docker-dockerfile.md) +- [Docker Cheat Sheet](docker-cheat-sheet.md) +- [Kubernetes 应用指南](kubernetes.md) ## 📚 资料 From 2920e96b0144a41cfdc8b53ce3d549ee94bf8af0 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: 2024年3月12日 18:38:55 +0800 Subject: [PATCH 17/20] =?UTF-8?q?fix:=20=E5=85=B6=E5=AE=83=E5=AD=90?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2logo=E6=98=BE=E7=A4=BA=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f0c20a76..24645b9f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -15,7 +15,7 @@ module.exports = { }, }, themeConfig: { - logo: 'images/dunwu-logo-100.png', + logo: '/images/dunwu-logo-100.png', repo: 'dunwu/linux-tutorial', repoLabel: 'Github', docsDir: 'docs', From 1b95fa90ccdfadcfb0e67dabf0a8e50efd30d6a1 Mon Sep 17 00:00:00 2001 From: dunwu Date: 2024年12月17日 07:54:15 +0800 Subject: [PATCH 18/20] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/linux/soft/jdk-install.md | 2 +- docs/linux/soft/maven-install.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/linux/soft/jdk-install.md b/docs/linux/soft/jdk-install.md index 6c29acb4..594ec498 100644 --- a/docs/linux/soft/jdk-install.md +++ b/docs/linux/soft/jdk-install.md @@ -97,7 +97,7 @@ $ tar -zxf jdk-8u162-linux-x64.tar.gz (3)配置系统环境变量 -执行 `/etc/profile` 命令,添加以下内容: +执行 `vi /etc/profile` 命令,添加以下内容: ```bash # JDK 的根路径 diff --git a/docs/linux/soft/maven-install.md b/docs/linux/soft/maven-install.md index 5b41c115..1ea46d0e 100644 --- a/docs/linux/soft/maven-install.md +++ b/docs/linux/soft/maven-install.md @@ -32,7 +32,7 @@ ``` # MAVEN 的根路径 export MAVEN_HOME=/opt/maven/apache-maven-3.5.2 -export PATH=\$MAVEN_HOME/bin:\$PATH +export PATH=$MAVEN_HOME/bin:$PATH ``` 执行 `source /etc/profile` ,立即生效 From 7bc0d6b346cd48b95ee167971e7ef182d849cc3b Mon Sep 17 00:00:00 2001 From: huhuhang Date: 2025年1月22日 14:07:13 +0800 Subject: [PATCH 19/20] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E7=BD=91=E7=AB=99=E9=93=BE=E6=8E=A5=E5=92=8C=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0=E8=B5=84=E6=BA=90=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 328d4182..b5e9a3de 100644 --- a/README.md +++ b/README.md @@ -110,17 +110,16 @@ - [linux-command](https://github.com/jaywcjlove/linux-command) - **社区网站** - [Linux 中国](https://linux.cn/) - 各种资讯、文章、技术 - - [实验楼](https://www.shiyanlou.com/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。 + - [LabEx 中国](https://labex.io/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。 - [鸟哥的 linux 私房菜](http://linux.vbird.org/) - 非常适合 Linux 入门初学者看的教程。 - [Linux 公社](http://www.linuxidc.com/) - Linux 相关的新闻、教程、主题、壁纸都有。 - [Linux Today](http://www.linuxde.net) - Linux 新闻资讯发布,Linux 职业技术学习!。 - **知识相关** - [Linux 思维导图整理](http://www.jianshu.com/p/59f759207862) - [Linux 初学者进阶学习资源整理](http://www.jianshu.com/p/fe2a790b41eb) - - [Linux 基础入门(新版)](https://www.shiyanlou.com/courses/1) + - [Linux 快速入门(动手实验)](https://labex.io/zh/courses/quick-start-with-linux) - [【译】Linux 概念架构的理解](http://www.jianshu.com/p/c5ae8f061cfe) [En](http://oss.org.cn/ossdocs/linux/kernel/a1/index.html) - [Linux 守护进程的启动方法](http://www.ruanyifeng.com/blog/2016/02/linux-daemon.html) - - [Linux 编程之内存映射](https://www.shiyanlou.com/questions/2992) - [Linux 知识点小结](https://blog.huachao.me/2016/1/Linux%E7%9F%A5%E8%AF%86%E7%82%B9%E5%B0%8F%E7%BB%93/) - [10 大白帽黑客专用的 Linux 操作系统](https://linux.cn/article-6971-1.html) - **软件工具** From 5eef25e2e44a55f2500e4a9272429c12f2699a89 Mon Sep 17 00:00:00 2001 From: Katzura <80234066+power-kid@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:55:17 +0800 Subject: [PATCH 20/20] Update linux-cli-dir.md --- docs/linux/cli/linux-cli-dir.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/linux/cli/linux-cli-dir.md b/docs/linux/cli/linux-cli-dir.md index 5bdd9f1b..16f82d4a 100644 --- a/docs/linux/cli/linux-cli-dir.md +++ b/docs/linux/cli/linux-cli-dir.md @@ -47,6 +47,21 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot - 第 2、5、8 位表示写权限,如果用"w"字符表示,则有写权限,如果用"-"字符表示没有写权限。 - 第 3、6、9 位表示可执行权限,如果用"x"字符表示,则有执行权限,如果用"-"字符表示,则没有执行权限。 +```bash +d rwx r-x r-x +↑ ↑↑↑ ↑↑↑ ↑↑↑ +│ │││ │││ │││-其他用户执行权限 (x/-) +│ │││ │││ │└─ 其他用户写权限 (w/-) +│ │││ │││ └── 其他用户读权限 (r/-) +│ │││ ││└──── 属组用户执行权限 (x/-) +│ │││ │└───── 属组用户写权限 (w/-) +│ │││ └────── 属组用户读权限 (r/-) +│ ││└──────── 属主用户执行权限 (x/-) +│ │└───────── 属主用户写权限 (w/-) +│ └────────── 属主用户读权限 (r/-) +└──────────── 文件类型 (该文件是目录) +``` + #### 1.2.1. Linux 文件属主和属组 ```bash

AltStyle によって変換されたページ (->オリジナル) /