• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

Grid環境構築用のChefリポジトリです。


コミットメタ情報

リビジョン31de978126f328908b767ffd8bb7bb48c675e581 (tree)
日時2016-11-21 22:16:06
作者whitestar <whitestar@gaea...>
コミッターwhitestar

ログメッセージ

dcos-grid-0.4.4

変更サマリ

差分

--- a/cookbooks/dcos-grid/CHANGELOG.md
+++ b/cookbooks/dcos-grid/CHANGELOG.md
@@ -1,6 +1,10 @@
11 dcos-grid CHANGELOG
22 ===================
33
4+0.4.4
5+-----
6+- improves upgrade scripts.
7+
48 0.4.3
59 -----
610 - refactoring.
--- a/cookbooks/dcos-grid/metadata.rb
+++ b/cookbooks/dcos-grid/metadata.rb
@@ -5,7 +5,7 @@ maintainer_email ''
55 license 'Apache 2.0'
66 description 'Installs/Configures DC/OS Cluster Node.'
77 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
8-version '0.4.3'
8+version '0.4.4'
99 source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
1010 issues_url 'https://osdn.jp/projects/metasearch/ticket'
1111
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/bootstrap_setup.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/bootstrap_setup.sh
@@ -63,20 +63,20 @@ fi
6363
6464 # Setup
6565 CMD='cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>'
66-echo "Command: $CMD"
66+echo "- Command: $CMD"
6767 $CMD
6868
6969 echo 'Downloading DC/OS release ...'
7070 CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>"
71-echo "Command: $CMD"
71+echo "- Command: $CMD"
7272 $CMD
7373
7474 echo 'Generating DC/OS configurations ...'
7575 CMD="$sudo bash dcos_generate_config.sh"
76-echo "Command: $CMD"
76+echo "- Command: $CMD"
7777 $CMD
7878
7979 echo 'Launching Docker container for the bootstrap service ...'
8080 CMD="$sudo docker run -d -p <%= node['dcos-grid']['bootstrap']['port'] %>:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx"
81-echo "Command: $CMD"
81+echo "- Command: $CMD"
8282 $CMD
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/bootstrap_upgrade.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/bootstrap_upgrade.sh
@@ -63,22 +63,32 @@ fi
6363
6464 # Upgrade
6565 CMD='cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>'
66-echo "Command: $CMD"
66+echo "- Command: $CMD"
67+$CMD
68+
69+echo 'Back up the current installation script ...'
70+CMD="$sudo mv ./genconf/serve ./genconf/serve-`date '+%Y%m%d_%H%M%S'`"
71+echo "- Command: $CMD"
6772 $CMD
6873
6974 echo 'Downloading new DC/OS release ...'
7075 CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>"
71-echo "Command: $CMD"
76+echo "- Command: $CMD"
7277 $CMD
7378
7479 echo 'Generating new DC/OS configurations ...'
7580 CMD="$sudo bash dcos_generate_config.sh"
76-echo "Command: $CMD"
81+echo "- Command: $CMD"
82+$CMD
83+
84+echo 'Back up the generated dcos_install.sh script ...'
85+CMD="$sudo cp ./genconf/serve/dcos_install.sh ./genconf/serve/dcos_install.sh.pkg-dist"
86+echo "- Command: $CMD"
7787 $CMD
7888
7989 echo 'Disable Docker restarts in dcos_install.sh'
8090 CMD="$sudo sed -i -e 's/systemctl restart systemd-journald//g' -e 's/systemctl restart docker//g' genconf/serve/dcos_install.sh"
81-echo "Command: $CMD"
91+echo "- Command: $CMD"
8292 eval $CMD
8393
8494 port=<%= node['dcos-grid']['bootstrap']['port'] %>
@@ -87,6 +97,14 @@ if $sudo docker ps | grep "${port}->80"; then
8797 else
8898 echo 'Launching Docker container for the bootstrap service ...'
8999 CMD="$sudo docker run -d -p ${port}:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx"
90- echo "Command: $CMD"
100+ echo "- Command: $CMD"
91101 $CMD
92102 fi
103+
104+cat << EOM
105+Please execute the following command in preparation to get new node in on the cluster
106+after the cluster upgrade finished.
107+ $ cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>
108+ $ sudo mv ./genconf/serve/dcos_install{,4upgrade}.sh
109+ $ sudo mv ./genconf/serve/dcos_install.sh{.pkg-dist,}
110+EOM
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/cli_setup.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/cli_setup.sh
@@ -61,7 +61,7 @@ fi
6161 CMD="$sudo curl <%= node['dcos-grid']['dcos_cli_release_url'] %> -o /usr/local/bin/dcos &&
6262 $sudo chmod +x /usr/local/bin/dcos &&
6363 $sudo /usr/local/bin/dcos config set core.dcos_url https://<%= node['dcos-grid']['bootstrap']['config']['master_list'][0] %>"
64-echo "Command: $CMD"
64+echo "- Command: $CMD"
6565 eval $CMD
6666
6767 # old way
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/node_setup.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/node_setup.sh
@@ -93,19 +93,19 @@ fi
9393
9494 if [ ! -d /tmp/dcos ]; then
9595 CMD='mkdir /tmp/dcos'
96- echo "Command: $CMD"
96+ echo "- Command: $CMD"
9797 $CMD
9898 fi
9999 CMD='cd /tmp/dcos'
100-echo "Command: $CMD"
100+echo "- Command: $CMD"
101101 $CMD
102102
103103 echo 'Downloading dcos_install.sh ...'
104104 CMD='curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh'
105-echo "Command: $CMD"
105+echo "- Command: $CMD"
106106 $CMD
107107
108108 echo "Installing DC/OS $ROLE node ..."
109109 CMD="$sudo bash dcos_install.sh $ROLE"
110-echo "Command: $CMD"
110+echo "- Command: $CMD"
111111 $CMD
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/node_upgrade.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/node_upgrade.sh
@@ -117,33 +117,33 @@ fi
117117 # Upgrade
118118 if [ ! -d /tmp/dcos ]; then
119119 CMD='mkdir /tmp/dcos'
120- echo "Command: $CMD"
120+ echo "- Command: $CMD"
121121 $CMD
122122 fi
123123 CMD='cd /tmp/dcos'
124-echo "Command: $CMD"
124+echo "- Command: $CMD"
125125 $CMD
126126
127127 echo 'Downloading new dcos_install.sh ...'
128128 CMD="$sudo curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh"
129-echo "Command: $CMD"
129+echo "- Command: $CMD"
130130 $CMD
131131
132132 echo 'Uninstalling pkgpanda ...'
133133 CMD="$sudo -i /opt/mesosphere/bin/pkgpanda uninstall"
134-echo "Command: $CMD"
134+echo "- Command: $CMD"
135135 $CMD
136136
137137 echo 'Removing data directory ...'
138138 CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere"
139-echo "Command: $CMD"
139+echo "- Command: $CMD"
140140 $CMD
141141
142142 case "$ROLE" in
143143 'master' )
144144 if [ $exhibitor_storage_backend != 'static' ]; then
145145 CMD="$sudo useradd --system --home-dir /opt/mesosphere --shell /sbin/nologin -c 'DCOS System User' dcos_exhibitor; $sudo chown -R dcos_exhibitor /var/lib/zookeeper"
146- echo "Command: $CMD"
146+ echo "- Command: $CMD"
147147 $CMD
148148 fi
149149 ;;
@@ -156,7 +156,7 @@ case "$ROLE" in
156156 # $ sudo mkdir -p /var/lib/dcos
157157 # $ sudo touch /var/lib/dcos/mesos-resources
158158 CMD="$sudo mkdir -p /var/lib/dcos; $sudo touch /var/lib/dcos/mesos-resources"
159- echo "Command: $CMD"
159+ echo "- Command: $CMD"
160160 $CMD
161161 #__CO__
162162 ;;
@@ -169,13 +169,13 @@ sleep 60s
169169
170170 echo "Installing DC/OS $ROLE node ..."
171171 CMD="$sudo bash dcos_install.sh $ROLE"
172-echo "Command: $CMD"
172+echo "- Command: $CMD"
173173 $CMD
174174
175175 case "$ROLE" in
176176 'master' )
177177 cat << EOM
178-Validate the upgrade
178+Please validate the upgrade
179179 - Monitor the Exhibitor UI to confirm that the Master rejoins the ZooKeeper
180180 quorum successfully (the status indicator will turn green). The Exhibitor
181181 UI is available at http://<dcos_master>:8181/.
@@ -187,7 +187,7 @@ EOM
187187 ;;
188188 'slave' | 'slave_public' )
189189 cat << EOM
190-Validate the upgrade
190+Please validate the upgrade
191191 - Verify that curl http://<dcos_agent_private_ip>:5051/metrics/snapshot has
192192 the metric slave/registered with a value of 1.
193193 - Monitor the Mesos UI to verify that the upgraded node rejoins the DC/OS
--- a/cookbooks/dcos-grid/templates/default/opt/dcos-grid/uninstall.sh
+++ b/cookbooks/dcos-grid/templates/default/opt/dcos-grid/uninstall.sh
@@ -69,13 +69,13 @@ install_dir=<%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>
6969 # for Bootstrap node
7070 if ls $install_dir | grep 'dcos-genconf.*.tar'; then
7171 CMD="$sudo rm ${install_dir}/dcos-genconf.*.tar"
72- echo "Command: $CMD"
72+ echo "- Command: $CMD"
7373 $CMD
7474 fi
7575
7676 if ls $install_dir | grep dcos_generate_config.sh; then
7777 CMD="$sudo rm ${install_dir}/dcos_generate_config.sh"
78- echo "Command: $CMD"
78+ echo "- Command: $CMD"
7979 $CMD
8080 fi
8181
@@ -84,21 +84,21 @@ pkgpanda=/opt/mesosphere/bin/pkgpanda
8484 if [ -e "$pkgpanda" ]; then
8585 echo 'Uninstalling DC/OS packages...'
8686 CMD="$sudo -i $pkgpanda uninstall"
87- echo "Command: $CMD"
87+ echo "- Command: $CMD"
8888 $CMD
8989 fi
9090
9191 if [ -e /opt/mesosphere ]; then
9292 echo 'Remove /opt/mesosphere and /etc/mesosphere ...'
9393 CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere"
94- echo "Command: $CMD"
94+ echo "- Command: $CMD"
9595 $CMD
9696 fi
9797
9898 if [ -e /tmp/dcos ]; then
9999 echo 'Remove /tmp/dcos ...'
100100 CMD="$sudo rm -rf /tmp/dcos"
101- echo "Command: $CMD"
101+ echo "- Command: $CMD"
102102 $CMD
103103 fi
104104
旧リポジトリブラウザで表示