Skip to content

Commit

Permalink
更新目录结构
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliang-ms committed Oct 27, 2021
1 parent 985eb5b commit f820db3
Show file tree
Hide file tree
Showing 31 changed files with 444 additions and 274 deletions.
2 changes: 1 addition & 1 deletion 1.Linux基础/1.1常用shell/01查询文件内`tab`键.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### 查询文件内`tab`
适用于`yaml`校验(制表符)

```shell script
```bash
grep $'\t' 文件名
```
4 changes: 2 additions & 2 deletions 1.Linux基础/1.1常用shell/02计算shell运行时间.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> `date`相减
```shell script
```bash
startTime=`date +%Y%m%d-%H:%M:%S`
startTime_s=`date +%s`

Expand All @@ -16,7 +16,7 @@ echo "$startTime ---> $endTime" "Total:$sumTime seconds"

> `time`
```shell script
```bash
time sh xxx.sh
# 会返回3个时间数据
# real 该命令的总耗时, 包括user和sys及io等待, 时间片切换等待等等
Expand Down
2 changes: 1 addition & 1 deletion 1.Linux基础/1.2包管理器/choco/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

管理员运行`cmd`,执行

```shell script
```bash
@powershell -NoProfile -ExecutionPolicy Bypass -Command
"iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=
%PATH
Expand Down
8 changes: 4 additions & 4 deletions 1.Linux基础/1.4软件更新/02升级gcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

> 安装依赖
```shell script
```bash
tar zxvf gmp-4.3.2.tar.gz
cd gmp-4.3.2
./configure --prefix=/usr/local/gmp-4.3.2 \
Expand All @@ -32,14 +32,14 @@ cd mpc-1.0.1

> 配置环境变量
```shell script
```bash
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/gmp-4.3.2/lib:/usr/local/mpc-1.0.1/lib:/usr/local/mpfr-2.4.2/lib" >> /etc/profile
. /etc/profile
```

> 编译`gcc`
```shell script
```bash
tar -xzvf gcc-5.4.0.tar.gz && mkdir gcc-5.4.0/gcc-build && cd gcc-5.4.0/gcc-build \
&& ../configure --prefix=/usr/local/gcc-5.4.0 --enable-threads=posix \
--disable-checking --disable-multilib --enable-languages=c,c++ \
Expand All @@ -49,7 +49,7 @@ tar -xzvf gcc-5.4.0.tar.gz && mkdir gcc-5.4.0/gcc-build && cd gcc-5.4.0/gcc-buil

> 备份更新
```shell script
```bash
mkdir -p /usr/local/bakup/gcc
mv /usr/bin/{gcc,g++} /usr/local/bakup/gcc/
cp /usr/local/gcc-5.4.0/bin/gcc /usr/bin/gcc
Expand Down
4 changes: 2 additions & 2 deletions 1.Linux基础/1.4软件更新/03升级openssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

> 2.安装必要依赖
```shell script
```bash
yum install -y wget gcc perl
```

> 3.解压编译
```shell script
```bash
tar zxvf openssl-OpenSSL_*.tar.gz
cd openssl-OpenSSL*
./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl
Expand Down
8 changes: 4 additions & 4 deletions 1.Linux基础/1.4软件更新/04升级openssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> 2.开启telnet(防止失败)
```shell script
```bash
yum install -y telnet-server telnet xinetd

systemctl restart telnet.socket
Expand Down Expand Up @@ -51,7 +51,7 @@ ssh -V

配置

```shell script
```bash
cat > /etc/ssh/sshd_config <<EOF
Protocol 2
SyslogFacility AUTHPRIV
Expand All @@ -74,14 +74,14 @@ EOF

调整`service`,重启`ssh`服务

```shell script
```bash
sed -i "s;Type=notify;#Type=notify;g" /usr/lib/systemd/system/sshd.service
systemctl daemon-reload && systemctl restart sshd
```

成功后关闭`telnet`

```shell script
```bash
systemctl disable telnet.socket --now
systemctl disable xinetd --now
```
8 changes: 4 additions & 4 deletions 1.Linux基础/skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

> 安装`ntfs-3g`
```shell script
```bash
yum -y install ntfs-3g
```

或离线安装,[离线包下载地址](https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz)

```shell script
```bash
yum -y install gcc
tar -zxvf ntfs-3g_ntfsprogs-2017.3.23.tgz
cd ntfs-3g_ntfsprogs-2017.3.23/
Expand All @@ -19,15 +19,15 @@ cd ntfs-3g_ntfsprogs-2017.3.23/

> 查询移动硬盘所在设备接口
```shell script
```bash
[root@node3 windows]# fdisk -l | grep NTFS
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
/dev/sdl1 2048 3907026943 1953512448 7 HPFS/NTFS/exFAT
```

> 创建挂载点,挂载
```shell script
```bash
mkdir -p /ntfs
mount -t ntfs-3g /dev/sdl1 /ntfs
```
Expand Down
2 changes: 1 addition & 1 deletion 2.容器/k8s/cmd/cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

> 清理`Evicted`状态`pod`
```shell script
```bash
for ns in `kubectl get ns | awk 'NR>1{print $1}'`
do
kubectl get pods -n ${ns} | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n ${ns}
Expand Down
4 changes: 2 additions & 2 deletions 2.容器/k8s/ingress/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
设置每个`location`读取客户端请求体的缓冲区大小。如果请求体大于缓冲区,则整个请求体或仅其部分被写入一个临时文件。
默认情况下,缓冲区大小等于两个内存页。这在`x86`、其他`32`位平台和`x86-64`上是`8K`。在其他`64`位平台上通常是`16K`

```shell script
```bash
nginx.ingress.kubernetes.io/client-body-buffer-size: 1M
```

对应原生`nginx`配置

```shell script
```bash
Syntax: client_body_buffer_size size;
Default:
client_body_buffer_size 8k|16k;
Expand Down
14 changes: 7 additions & 7 deletions 2.容器/k8s/install/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> 下载解压配置
```shell script
```bash
tar zxvf go1.16.5.linux-amd64.tar.gz -C /usr/local/
cat >> ~/.bash_profile <<EOF
export GOPROOT=/usr/local/go
Expand All @@ -17,7 +17,7 @@ EOF

### 编译全部组件

```shell script
```bash
unzip kubernetes-1.18.6.zip
cd kubernetes-1.18.6
yum install -y rsync
Expand All @@ -33,14 +33,14 @@ make -j4
- [etcd-v3.3.9-linux-amd64.tar.gz](https://github.com/etcd-io/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz)

```shell script
```bash
tar -zxvf etcd-v3.3.9-linux-amd64.tar.gz
sudo cp etcd-v3.3.9-linux-amd64/{etcd,etcdctl} /usr/bin/
```

> 配置服务
```shell script
```bash
sudo tee /usr/lib/systemd/system/etcd.service <<EOF
[Unit]
Description=Etcd Server
Expand All @@ -59,20 +59,20 @@ EOF

> 创建目录
```shell script
```bash
mkdir /var/lib/etcd
```

> 启动
```shell script
```bash
sudo systemctl daemon-reload
sudo systemctl enable etcd.service --now
```

> 查看集群状态
```shell script
```bash
[root@localhost ~]# etcdctl cluster-health
member 8e9e05c52164694d is healthy: got healthy result from http://localhost:2379
cluster is healthy
Expand Down
10 changes: 5 additions & 5 deletions 2.容器/k8s/install/k8s-kubeadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,22 @@ echo "DefaultLimitNPROC=1024000" >> /etc/systemd/system.conf

> 查看版本列表
```shell script
```bash
yum list kubeadm --showduplicates|sort -r
```

> 安装指定版本`kubeadm`
安装`1.18.6`版本

```shell script
```bash
version=1.18.6-0
yum install -y kubelet-$version kubeadm-$version kubectl-$version --disableexcludes=kubernetes
```

> 安装命令补全
```shell script
```bash
yum install -y bash-completion
source /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
Expand All @@ -106,13 +106,13 @@ echo "source <(kubectl completion bash)" >> ~/.bashrc

> 启动`kubelet`
```shell script
```bash
systemctl enable kubelet --now
```

下载k8s相关镜像

```shell script
```bash
for i in `kubeadm config images list 2>/dev/null |sed 's/k8s.gcr.io\///g'`; do
docker pull registry.aliyuncs.com/google-containers/${i}
docker tag registry.aliyuncs.com/google-containers/${i} k8s.gcr.io/${i}
Expand Down
Loading

0 comments on commit f820db3

Please sign in to comment.