## 挂载数据盘
- root 下

```
fdisk -l
fdisk /dev/vdb
n
p
回车 回车 回车
w
partprobe && mkfs -t ext4 /dev/vdb1

创建 /data 并初步 mount
mount /dev/vdb1 /data && rm /data/lost+found/ -rf && ll /data

设置开机自动mount
blkid 命令
/dev/vdb1: UUID="17bd6c0f-da89-49a1-9e52-a2b0d6e4de22" TYPE="ext4" 

修改/etc/fstab, 末尾加新行
UUID=17bd6c0f-da89-49a1-9e52-a2b0d6e4de22 /data ext4 defaults,errors=remount-ro 0 2
```

## 新文件夹和配置数据文件
- 在挂载/data数据盘成功后执行
```
cd /data && mkdir appstore log frank
cd appstore && mkdir appstorelog nginx product 
mkdir -p /data/log/appstore-thrift
cd /data/appstore/appstorelog && mkdir action impre match
chown nobody action impre match && chgrp nobody action impre match
mkdir -p /data/appstore/product/appstore-nginx/ && mkdir -p /data/appstore/product/backup && mkdir /data/deploy
```

- nginx stg 的 /etc/hosts 下添加 IP
- nginx stg 下执行
 - scp -r /data/appstore/cached/ nginx-3:/data/appstore/


## thriftc
cd ~/frank
git clone http://frank.chen:Qwer%401234@git.dt-dtg5.com/t1/appstore-thrift.git
cd appstore-thrift/src && git checkout frank2 && thrift --gen cpp synch_service.thrift
mkdir build && cd build
cmake .. && make -j7 && make install


- 配置 systemctl
cd /usr/lib/systemd/system
vi appstore-thrift.service

```
[Unit]
Description=Thriftc daemon

[Service]
LimitCORE=infinity
LimitNOFILE=102400
LimitNPROC=65535
Type=simple
User=root
WorkingDirectory=/data/log/appstore-thrift
ExecStart=/usr/local/bin/Thriftc
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target
```
systemctl enable appstore-thrift.service 
systemctl start appstore-thrift.service && xps Thriftc


## thrift_watch
- 使用 fabric 脚本来执行

## 定时任务
### nginx-1
由于要做镜像，所以没开启定时任务







