From 4c95ac5f04a7ed7a7e12fdf09b73f57803414787 Mon Sep 17 00:00:00 2001 From: newnius Date: Thu, 30 Mar 2017 17:08:10 +0800 Subject: [PATCH] make hexo start at start-up, remove unnecessary config when starting hadoop --- hadoop/2.7.1/README | 16 ++-------------- hexo/Dockerfile | 2 +- hexo/README.md | 12 +++++++++--- hexo/bootstrap.sh | 2 +- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/hadoop/2.7.1/README b/hadoop/2.7.1/README index 3bad9de..3003f14 100644 --- a/hadoop/2.7.1/README +++ b/hadoop/2.7.1/README @@ -1,8 +1,8 @@ # based on sequenceiq/hadoop-docker -## create a hadoop cluster in swarm mode +## Create a hadoop cluster in swarm mode -`--hostname` need 1.13 or higher +`--hostname` needs 1.13 or higher ``` docker service create \ @@ -10,9 +10,6 @@ docker service create \ --network swarm-net \ --hostname hadoop-master \ --replicas 1 \ ---mount type=bind,source=/mnt/data/hadoop/hdfs/master,target=/tmp/hadoop-root \ ---mount type=bind,source=/mnt/data/hadoop/logs/master,target=/usr/local/hadoop/logs \ ---mount type=bind,source=/mnt/data/hadoop/config,target=/mnt/hadoop-config \ --endpoint-mode dnsrr \ newnius/hadoop ``` @@ -23,9 +20,6 @@ docker service create \ --network swarm-net \ --hostname hadoop-slave1 \ --replicas 1 \ ---mount type=bind,source=/mnt/data/hadoop/hdfs/slave1,target=/tmp/hadoop-root \ ---mount type=bind,source=/mnt/data/hadoop/logs/slave1,target=/usr/local/hadoop/logs \ ---mount type=bind,source=/mnt/data/hadoop/config,target=/mnt/hadoop-config \ --endpoint-mode dnsrr \ newnius/hadoop ``` @@ -36,9 +30,6 @@ docker service create \ --network swarm-net \ --hostname hadoop-slave2 \ --replicas 1 \ ---mount type=bind,source=/mnt/data/hadoop/hdfs/slave2,target=/tmp/hadoop-root \ ---mount type=bind,source=/mnt/data/hadoop/logs/slave2,target=/usr/local/hadoop/logs \ ---mount type=bind,source=/mnt/data/hadoop/config,target=/mnt/hadoop-config \ --endpoint-mode dnsrr \ newnius/hadoop ``` @@ -49,9 +40,6 @@ docker service create \ --network swarm-net \ --hostname hadoop-slave3 \ --replicas 1 \ ---mount type=bind,source=/mnt/data/hadoop/hdfs/slave3,target=/tmp/hadoop-root \ ---mount type=bind,source=/mnt/data/hadoop/logs/slave3,target=/usr/local/hadoop/logs \ ---mount type=bind,source=/mnt/data/hadoop/config,target=/mnt/hadoop-config \ --endpoint-mode dnsrr \ newnius/hadoop ``` diff --git a/hexo/Dockerfile b/hexo/Dockerfile index 898fe32..802bcef 100644 --- a/hexo/Dockerfile +++ b/hexo/Dockerfile @@ -18,4 +18,4 @@ ADD bootstrap.sh /etc/bootstrap.sh WORKDIR /blog -CMD ["bash", "/etc/bootstrap.sh", "nothing"] +ENTRYPOINT ["/etc/bootstrap.sh"] diff --git a/hexo/README.md b/hexo/README.md index 19620ad..ab007e0 100644 --- a/hexo/README.md +++ b/hexo/README.md @@ -2,14 +2,20 @@ https://hexo.io/zh-cn/ http://theme-next.iissnan.com/ -First Time: +First Time(not inited): docker service create \ --name hexo \ ---publish 4000:4000 \ +--publish 80:4000 \ -e GIT_EMAIL="me@newnius.com" \ -e GIT_NAME="newnius" \ --mount type=bind,source=/mnt/data/blog,target=/blog \ newnius/hexo Start Server: -docker service create --name hexo --publish 4000:4000 --mount type=bind,source=/mnt/data/blog,target=/blog newnius/hexo /etc/bootstrap.sh server +docker service create \ +--name hexo \ +--publish 80:4000 \ +-e GIT_EMAIL="me@newnius.com" \ +-e GIT_NAME="newnius" \ +--mount type=bind,source=/mnt/data/blog,target=/blog \ +newnius/hexo server diff --git a/hexo/bootstrap.sh b/hexo/bootstrap.sh index 2b7a8c9..1dfc989 100755 --- a/hexo/bootstrap.sh +++ b/hexo/bootstrap.sh @@ -3,7 +3,7 @@ git config --global user.email $GIT_EMAIL git config --global user.name $GIT_NAME -if [ "$1" == "server" ]; then +if [ "$1" = "server" ]; then # start hexo server echo "starting hexo..." hexo server