Skip to content

Commit

Permalink
更新文档内容
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliang-ms committed Oct 10, 2023
1 parent e3149b2 commit dfd8936
Show file tree
Hide file tree
Showing 28 changed files with 988 additions and 91 deletions.
20 changes: 0 additions & 20 deletions 1.Linux基础/1.1常用shell/03防火墙开放端口.md

This file was deleted.

6 changes: 6 additions & 0 deletions 1.Linux基础/1.1常用shell/99获取系统信息.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### 查看系统UUID

```shell
$ cat /sys/class/dmi/id/product_uuid
ff594d56-e05f-a672-39de-806201d083e4
```
48 changes: 48 additions & 0 deletions 1.Linux基础/1.1常用shell/防火墙相关.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
### 防火墙开放端口

- `el6`

```shell
#开放端口(7777)
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7777 -j ACCEPT
#保存
/etc/rc.d/init.d/iptables save
#重载
service iptables restart
```

- `el7`

```shell
firewall-cmd --zone=public --add-port=7777/tcp --permanent
#重新载入
firewall-cmd --reload
```

### 删除所有规则

```shell
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P INPUT ACCEPT
iptables -t mangle -P FORWARD ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -t mangle -P POSTROUTING ACCEPT
iptables -F
iptables -X
iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t raw -F
iptables -t raw -X
iptables -t raw -P PREROUTING ACCEPT
iptables -t raw -P OUTPUT ACCEPT

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```shell
ps aux | awk '/yum/{system("kill-9"$2)}'
#清除rpm库文件
rm -f /var/lib/rpm/__db*
#重新构建
rpm --rebuilddb
#清除yum缓存
yum clean all && rm -rf /var/cache/yum
#重新缓存
yum makecache
```
6 changes: 6 additions & 0 deletions 1.Linux基础/1.3系统设置/01时钟服务器配置.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ $ hwclock -r

```shell
$ hwclock --systohc
```

手动同步

```shell
timedatectl set-ntp true
```
1 change: 0 additions & 1 deletion 1.Linux基础/1.6虚拟化/01vsphere使用.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,4 @@ df -h
```

![](images/extended_disk.jpg)


5 changes: 5 additions & 0 deletions 1.Linux基础/1.6虚拟化/exsi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 设置主机名

```shell
esxcfg-advcfg -s 新的主机名称 /Misc/hostname
```
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ metadata:
namespace: ceph-csi
stringData:
# Required for statically provisioned volumes
userID: cephfs
userKey: AQCoW0dgQk4qGhAAwayKv70OSyyWB3XpZ1JLYQ==
userID: admin
userKey: AQCJe+Bfb6JtOhAANdn/FmcTj179PW6EI4KTng==
# Required for dynamically provisioned volumes
adminID: admin
adminKey: AQDkTjNgNObEHBAANGLCF23SLKYmqUd2Nxtbaw==
adminKey: AQCJe+Bfb6JtOhAANdn/FmcTj179PW6EI4KTng==
EOF
```

Expand All @@ -157,15 +157,15 @@ sed -i -e "/^kind: ServiceAccount/{N;N;a\ namespace: ceph-csi # 输入到这
> 8.创建`ServiceAccount``RBAC ClusterRole/ClusterRoleBinding`资源对象
```shell
kubectl create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-provisioner-rbac.yaml
kubectl create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml
kubectl apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-provisioner-rbac.yaml
kubectl apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml
```

> 9.创建`PodSecurityPolicy`
```shell
kubectl create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-provisioner-psp.yaml
kubectl create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-nodeplugin-psp.yaml
kubectl apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-provisioner-psp.yaml
kubectl apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-nodeplugin-psp.yaml
```

> 10.调整`csi-cephfsplugin-provisioner.yaml``csi-cephfsplugin.yaml`
Expand All @@ -190,8 +190,8 @@ k8s.gcr.io/sig-storage/csi-resizer:v1.0.1
> 11.发布`csi-cephfsplugin-provisioner.yaml``csi-cephfsplugin.yaml`
```shell
kubectl -n ceph-csi create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml
kubectl -n ceph-csi create -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml
kubectl -n ceph-csi apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml
kubectl -n ceph-csi apply -f ceph-csi-3.2.0/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml
```

> 12.查看运行状态
Expand All @@ -212,10 +212,10 @@ cat <<EOF > ceph-csi-3.2.0/deploy/cephfs/kubernetes/storageclass.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ceph-csi-cephfs-sc
name: kubernetes-csi-fs-sc
provisioner: cephfs.csi.ceph.com
parameters:
clusterID: b1c2511e-a1a5-4d6d-a4be-0e7f0d6d4294
clusterID: 1fc9f495-498c-4fe2-b3d5-80a041bc5c49
pool: cephfs_data
fsName: k8s-cephfs
imageFeatures: layering
Expand Down
1 change: 0 additions & 1 deletion 1.Linux基础/1.9安全/06-设置会话超时.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
将值设置为`readonly` 防止用户更改
```shell
echo "export TMOUT=300" >>/etc/profile
echo "readonly TMOUT" >>/etc/profile
. /etc/profile
```
24 changes: 12 additions & 12 deletions 1.Linux基础/rockylinux/08安装mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-
2. 解压

```shell
$ tar zxvf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz -C /usr/local
tar zxvf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz -C /usr/local
```

3. 创建用户授权

```shell
$ useradd mysql
$ mv /usr/local/mysql-5.7.38-linux-glibc2.12-x86_64 /usr/local/mysql
$ chown mysql:mysql -R /usr/local/mysql
$ echo "export PATH=\$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
$ source ~/.bash_profile
useradd mysql
mv /usr/local/mysql-5.7.38-linux-glibc2.12-x86_64 /usr/local/mysql
chown mysql:mysql -R /usr/local/mysql
echo "export PATH=\$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
source ~/.bash_profile
```

4. 创建配置文件
Expand Down Expand Up @@ -103,11 +103,11 @@ EOF
5. 创建所需目录

```shell
$ mkdir -p /var/run/mysqld
$ chown mysql:mysql /var/run/mysqld
$ touch /var/log/mysqld.log /var/log/slow-query.log
$ chown mysql:mysql /var/log/mysqld.log
$ chown mysql:mysql /var/log/slow-query.log
mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld
touch /var/log/mysqld.log /var/log/slow-query.log
chown mysql:mysql /var/log/mysqld.log
chown mysql:mysql /var/log/slow-query.log
```

6. 创建service
Expand Down Expand Up @@ -158,7 +158,7 @@ EOF
7. 初始化数据

```shell
$ /usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql
```

8. 启动mysql
Expand Down
6 changes: 6 additions & 0 deletions 1.Linux基础/rockylinux/10配置chrony.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ EOF
启动
```shell
$ systemctl enable chronyd --now
```

手动同步

```shell
timedatectl set-ntp true
```
Loading

0 comments on commit dfd8936

Please sign in to comment.