william

Keep Calm and Markdown.

Docker 运维小记

安装 Docker

删除旧版本

1
2
3
4
5
6
7
8
sudo yum remove docker \
	docker-client \
	docker-client-latest \
	docker-common \
	docker-latest \
	docker-latest-logrotate \
	docker-logrotate \
	docker-engine

python 打包 packages

项目结构

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
├── readme.md
├── wepy
│   ├── ch
│   ├── __init__.py
│   ├── __pycache__
│   ├── requirements.txt
│   ├── setup.py
│   ├── utils
│   ├── __version__.py
│   └── wechat

rsync 自动重连

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
while true
do
    sleep 1
    #rsync --progress -avPz -r -e "ssh -p60001" tbt.colo101.$(date +"%Y%m")*.tar.bz2 ops@58.33.72.179:/data/Xtp/FromZZ.SH
    exitCode=$?

    ## -------------------------------------------------------------------------
    case $exitCode in
    10 | 23 | 30 | 35)
      echo "$(date): rsync finished with a network related error: $exitCode"
      ;;
    0)
      echo "$(date): rsync finished without error"
      break  # leave the while loop
      ;;
    *)  # all other cases
      echo "$(date): rsync finished with an unexpected error: $exitCode"
      ## break  # we don't know whether repeating it makes sense
      ;;
    esac
    ## -------------------------------------------------------------------------

done

Linux cpu 隔核设置

设置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 查看多少个 cpu 核
cat /proc/cpuinfo |grep "model name"

## 修改 grub
vim /etc/default/grub

## 找到 GRUB_CMDLINE_LINUX 增加
## 隔离 1-2, 7-8
## 从 0 开始计数
ioslcpus=1-2,7-8

## 更新配置
grub2-mkconfig -o /boot/grub2/grub.cfg

## 重启生效
reboot

## 查看是否生效
cat /proc/cmdline
0%