Grid環境構築用のChefリポジトリです。
リビジョン | 31de978126f328908b767ffd8bb7bb48c675e581 (tree) |
---|---|
日時 | 2016-11-21 22:16:06 |
作者 | whitestar <whitestar@gaea...> |
コミッター | whitestar |
dcos-grid-0.4.4
@@ -1,6 +1,10 @@ | ||
1 | 1 | dcos-grid CHANGELOG |
2 | 2 | =================== |
3 | 3 | |
4 | +0.4.4 | |
5 | +----- | |
6 | +- improves upgrade scripts. | |
7 | + | |
4 | 8 | 0.4.3 |
5 | 9 | ----- |
6 | 10 | - refactoring. |
@@ -5,7 +5,7 @@ maintainer_email '' | ||
5 | 5 | license 'Apache 2.0' |
6 | 6 | description 'Installs/Configures DC/OS Cluster Node.' |
7 | 7 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) |
8 | -version '0.4.3' | |
8 | +version '0.4.4' | |
9 | 9 | source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git' |
10 | 10 | issues_url 'https://osdn.jp/projects/metasearch/ticket' |
11 | 11 |
@@ -63,20 +63,20 @@ fi | ||
63 | 63 | |
64 | 64 | # Setup |
65 | 65 | CMD='cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>' |
66 | -echo "Command: $CMD" | |
66 | +echo "- Command: $CMD" | |
67 | 67 | $CMD |
68 | 68 | |
69 | 69 | echo 'Downloading DC/OS release ...' |
70 | 70 | CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>" |
71 | -echo "Command: $CMD" | |
71 | +echo "- Command: $CMD" | |
72 | 72 | $CMD |
73 | 73 | |
74 | 74 | echo 'Generating DC/OS configurations ...' |
75 | 75 | CMD="$sudo bash dcos_generate_config.sh" |
76 | -echo "Command: $CMD" | |
76 | +echo "- Command: $CMD" | |
77 | 77 | $CMD |
78 | 78 | |
79 | 79 | echo 'Launching Docker container for the bootstrap service ...' |
80 | 80 | 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" | |
82 | 82 | $CMD |
@@ -63,22 +63,32 @@ fi | ||
63 | 63 | |
64 | 64 | # Upgrade |
65 | 65 | 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" | |
67 | 72 | $CMD |
68 | 73 | |
69 | 74 | echo 'Downloading new DC/OS release ...' |
70 | 75 | CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>" |
71 | -echo "Command: $CMD" | |
76 | +echo "- Command: $CMD" | |
72 | 77 | $CMD |
73 | 78 | |
74 | 79 | echo 'Generating new DC/OS configurations ...' |
75 | 80 | 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" | |
77 | 87 | $CMD |
78 | 88 | |
79 | 89 | echo 'Disable Docker restarts in dcos_install.sh' |
80 | 90 | 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" | |
82 | 92 | eval $CMD |
83 | 93 | |
84 | 94 | port=<%= node['dcos-grid']['bootstrap']['port'] %> |
@@ -87,6 +97,14 @@ if $sudo docker ps | grep "${port}->80"; then | ||
87 | 97 | else |
88 | 98 | echo 'Launching Docker container for the bootstrap service ...' |
89 | 99 | 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" | |
91 | 101 | $CMD |
92 | 102 | 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 |
@@ -61,7 +61,7 @@ fi | ||
61 | 61 | CMD="$sudo curl <%= node['dcos-grid']['dcos_cli_release_url'] %> -o /usr/local/bin/dcos && |
62 | 62 | $sudo chmod +x /usr/local/bin/dcos && |
63 | 63 | $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" | |
65 | 65 | eval $CMD |
66 | 66 | |
67 | 67 | # old way |
@@ -93,19 +93,19 @@ fi | ||
93 | 93 | |
94 | 94 | if [ ! -d /tmp/dcos ]; then |
95 | 95 | CMD='mkdir /tmp/dcos' |
96 | - echo "Command: $CMD" | |
96 | + echo "- Command: $CMD" | |
97 | 97 | $CMD |
98 | 98 | fi |
99 | 99 | CMD='cd /tmp/dcos' |
100 | -echo "Command: $CMD" | |
100 | +echo "- Command: $CMD" | |
101 | 101 | $CMD |
102 | 102 | |
103 | 103 | echo 'Downloading dcos_install.sh ...' |
104 | 104 | CMD='curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh' |
105 | -echo "Command: $CMD" | |
105 | +echo "- Command: $CMD" | |
106 | 106 | $CMD |
107 | 107 | |
108 | 108 | echo "Installing DC/OS $ROLE node ..." |
109 | 109 | CMD="$sudo bash dcos_install.sh $ROLE" |
110 | -echo "Command: $CMD" | |
110 | +echo "- Command: $CMD" | |
111 | 111 | $CMD |
@@ -117,33 +117,33 @@ fi | ||
117 | 117 | # Upgrade |
118 | 118 | if [ ! -d /tmp/dcos ]; then |
119 | 119 | CMD='mkdir /tmp/dcos' |
120 | - echo "Command: $CMD" | |
120 | + echo "- Command: $CMD" | |
121 | 121 | $CMD |
122 | 122 | fi |
123 | 123 | CMD='cd /tmp/dcos' |
124 | -echo "Command: $CMD" | |
124 | +echo "- Command: $CMD" | |
125 | 125 | $CMD |
126 | 126 | |
127 | 127 | echo 'Downloading new dcos_install.sh ...' |
128 | 128 | CMD="$sudo curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh" |
129 | -echo "Command: $CMD" | |
129 | +echo "- Command: $CMD" | |
130 | 130 | $CMD |
131 | 131 | |
132 | 132 | echo 'Uninstalling pkgpanda ...' |
133 | 133 | CMD="$sudo -i /opt/mesosphere/bin/pkgpanda uninstall" |
134 | -echo "Command: $CMD" | |
134 | +echo "- Command: $CMD" | |
135 | 135 | $CMD |
136 | 136 | |
137 | 137 | echo 'Removing data directory ...' |
138 | 138 | CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere" |
139 | -echo "Command: $CMD" | |
139 | +echo "- Command: $CMD" | |
140 | 140 | $CMD |
141 | 141 | |
142 | 142 | case "$ROLE" in |
143 | 143 | 'master' ) |
144 | 144 | if [ $exhibitor_storage_backend != 'static' ]; then |
145 | 145 | 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" | |
147 | 147 | $CMD |
148 | 148 | fi |
149 | 149 | ;; |
@@ -156,7 +156,7 @@ case "$ROLE" in | ||
156 | 156 | # $ sudo mkdir -p /var/lib/dcos |
157 | 157 | # $ sudo touch /var/lib/dcos/mesos-resources |
158 | 158 | CMD="$sudo mkdir -p /var/lib/dcos; $sudo touch /var/lib/dcos/mesos-resources" |
159 | - echo "Command: $CMD" | |
159 | + echo "- Command: $CMD" | |
160 | 160 | $CMD |
161 | 161 | #__CO__ |
162 | 162 | ;; |
@@ -169,13 +169,13 @@ sleep 60s | ||
169 | 169 | |
170 | 170 | echo "Installing DC/OS $ROLE node ..." |
171 | 171 | CMD="$sudo bash dcos_install.sh $ROLE" |
172 | -echo "Command: $CMD" | |
172 | +echo "- Command: $CMD" | |
173 | 173 | $CMD |
174 | 174 | |
175 | 175 | case "$ROLE" in |
176 | 176 | 'master' ) |
177 | 177 | cat << EOM |
178 | -Validate the upgrade | |
178 | +Please validate the upgrade | |
179 | 179 | - Monitor the Exhibitor UI to confirm that the Master rejoins the ZooKeeper |
180 | 180 | quorum successfully (the status indicator will turn green). The Exhibitor |
181 | 181 | UI is available at http://<dcos_master>:8181/. |
@@ -187,7 +187,7 @@ EOM | ||
187 | 187 | ;; |
188 | 188 | 'slave' | 'slave_public' ) |
189 | 189 | cat << EOM |
190 | -Validate the upgrade | |
190 | +Please validate the upgrade | |
191 | 191 | - Verify that curl http://<dcos_agent_private_ip>:5051/metrics/snapshot has |
192 | 192 | the metric slave/registered with a value of 1. |
193 | 193 | - Monitor the Mesos UI to verify that the upgraded node rejoins the DC/OS |
@@ -69,13 +69,13 @@ install_dir=<%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %> | ||
69 | 69 | # for Bootstrap node |
70 | 70 | if ls $install_dir | grep 'dcos-genconf.*.tar'; then |
71 | 71 | CMD="$sudo rm ${install_dir}/dcos-genconf.*.tar" |
72 | - echo "Command: $CMD" | |
72 | + echo "- Command: $CMD" | |
73 | 73 | $CMD |
74 | 74 | fi |
75 | 75 | |
76 | 76 | if ls $install_dir | grep dcos_generate_config.sh; then |
77 | 77 | CMD="$sudo rm ${install_dir}/dcos_generate_config.sh" |
78 | - echo "Command: $CMD" | |
78 | + echo "- Command: $CMD" | |
79 | 79 | $CMD |
80 | 80 | fi |
81 | 81 |
@@ -84,21 +84,21 @@ pkgpanda=/opt/mesosphere/bin/pkgpanda | ||
84 | 84 | if [ -e "$pkgpanda" ]; then |
85 | 85 | echo 'Uninstalling DC/OS packages...' |
86 | 86 | CMD="$sudo -i $pkgpanda uninstall" |
87 | - echo "Command: $CMD" | |
87 | + echo "- Command: $CMD" | |
88 | 88 | $CMD |
89 | 89 | fi |
90 | 90 | |
91 | 91 | if [ -e /opt/mesosphere ]; then |
92 | 92 | echo 'Remove /opt/mesosphere and /etc/mesosphere ...' |
93 | 93 | CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere" |
94 | - echo "Command: $CMD" | |
94 | + echo "- Command: $CMD" | |
95 | 95 | $CMD |
96 | 96 | fi |
97 | 97 | |
98 | 98 | if [ -e /tmp/dcos ]; then |
99 | 99 | echo 'Remove /tmp/dcos ...' |
100 | 100 | CMD="$sudo rm -rf /tmp/dcos" |
101 | - echo "Command: $CMD" | |
101 | + echo "- Command: $CMD" | |
102 | 102 | $CMD |
103 | 103 | fi |
104 | 104 |