using docker(# export import container)
docker에 설치된 데이터들을 backup -> restore 해보기
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73b1430f15b7 centos "/bin/bash" 2 minutes ago Exited (0) About a minute ago hbasemaster
4c865448f160 centos:7 "init" 30 hours ago Up 30 hours namenode
3418386aa3a9 ubuntu "/bin/bash" 46 hours ago Exited (100) 31 hours ago hadoop-base
77b64bf03966 kyligence/superset-kylin:latest "bin/bootstrap.sh ..." 2 days ago Exited (137) 47 hours ago kylin
[root@kylin hbase-2.2.0]# docker commit -p 4c865448f160 namenode
sha256:04c47bead303230a48aa18bde596d6251fec69e593f0de318868eb612bae3c8a
[root@kylin hbase-2.2.0]#docker export 4c865448f160 > hadoopct.tar
[root@kylin hbase-2.2.0]#
### import docker image
[root@kylin ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@kylin ~]# ls
anaconda-ks.cfg hadoopct.tar initial-setup-ks.cfg
[root@kylin ~]# docker import hadoopct.tar hadoop1
sha256:ff75e855b2512cafe9c63be3cc3c8444b02e11eb1ec59ff43bd29a86e5b913c6
[root@kylin ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hadoop1 latest ff75e855b251 About a minute ago 1.7 GB
[root@kylin ~]# docker run -i -t --name hello hadoop1 /bin/bash
[root@a9bb5aa82130 /]#
1. 환경준비
centos 7.6
docker
docker
2.backup container
[root@kylin hbase-2.2.0]# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
73b1430f15b7 centos "/bin/bash" 2 minutes ago Exited (0) About a minute ago hbasemaster
4c865448f160 centos:7 "init" 30 hours ago Up 30 hours namenode
3418386aa3a9 ubuntu "/bin/bash" 46 hours ago Exited (100) 31 hours ago hadoop-base
77b64bf03966 kyligence/superset-kylin:latest "bin/bootstrap.sh ..." 2 days ago Exited (137) 47 hours ago kylin
[root@kylin hbase-2.2.0]# docker commit -p 4c865448f160 namenode
sha256:04c47bead303230a48aa18bde596d6251fec69e593f0de318868eb612bae3c8a
[root@kylin hbase-2.2.0]#docker export 4c865448f160 > hadoopct.tar
[root@kylin hbase-2.2.0]#
### import docker image
[root@kylin ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@kylin ~]# ls
anaconda-ks.cfg hadoopct.tar initial-setup-ks.cfg
[root@kylin ~]# docker import hadoopct.tar hadoop1
sha256:ff75e855b2512cafe9c63be3cc3c8444b02e11eb1ec59ff43bd29a86e5b913c6
[root@kylin ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hadoop1 latest ff75e855b251 About a minute ago 1.7 GB
[root@kylin ~]# docker run -i -t --name hello hadoop1 /bin/bash
[root@a9bb5aa82130 /]#
댓글
댓글 쓰기