Linux恢复安装

来自ling
跳转至: 导航搜索

备份

cd /alidata
tar -zcvf /alidata/backup/dockerdata20170520.tar.gz dockerdata

安装linux

恢复配置

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum makecache
yum update
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://3ue1wki2.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
systemctl disable firewalld
systemctl stop firewalld

yum -y install iptables-services
vi /etc/sysconfig/iptables

更多参见iptables

来自 <http://blog.csdn.net/guochunyang/article/details/49865441>

  • 查看磁盘
fdisk -l 
  • 查看使用情况
df -lh
  • 挂载磁盘

如果使用 UUID,则先通过 “blkid /dev/sdc1” 命令,得到磁盘的 UUID,

/dev/sdc1: UUID="185dc58b-3f12-4e90-952e-7acfa3e0b6fb" 

然后在 /etc/fstab 里面,加入:

UUID=185dc58b-3f12-4e90-952e-7acfa3e0b6fb /mnt/mydisk ext4 defaults 0 2
mount -o rw  /dev/sdc /mnt/usb
Cd /alidata
tar -zcvf /tmp/etc.tar.gz dockerdata

tar -zxvf /mnt/usb/dockerdata.tar.gz /alidata

fdisk.ext3 /dev/sdc
Mkdir /alidata
Mkdir /backup
mount -o rw  /dev/sdb /alidata
mount -o rw  /dev/sdc /backup
docker run --name mysql --restart=always -p 3306:3306 -v /alidata/dockerdata/mysqldata/mysql-cloud:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Wb19831010! -d mysql
docker run --name mediawiki  --restart=always  --link mysql:mysql  -v /alidata/dockerdata/mediawiki/images:/var/www/html/images  -v /alidata/dockerdata/mediawiki/LocalSettings.php:/var/www/html/LocalSettings.php  -v /alidata/dockerdata/wordpress:/var/www/html/wordpress  --link mysql:mysql -p 73:80 -d synctree/mediawiki

nginx

yum install nginx
nginx -s stop
nginx  -c /alidata/server/nginx/conf/nginx.conf

更多参考Nginx-lingserver 阿里云nginx配置