dcos-grid CHANGELOG
===================
+0.4.3
+-----
+- refactoring.
+- updates `docker-grid` cookbook dependency.
+- updates `['dcos-grid']['dcos_cli_release_url']` default value.
+- adds `['dcos-grid']['dcos_cli_upgrade']` attribute.
+- adds node upgrade scripts.
+
0.4.2
-----
- bug fix: generating genconf/config.yaml
- [dcos-grid::node-commons](#dcos-gridnode-commons)
- [dcos-grid::public-agent](#dcos-gridpublic-agent)
- [Role Examples](#role-examples)
+ - [Upgrade DC/OS (ver. 0.4.3 or later)](#upgrade-dcos-ver-043-or-later)
- [Uninstall DC/OS](#uninstall-dcos)
- [License and Authors](#license-and-authors)
|Key|Type|Description, example|Default|
|:--|:--|:--|:--|
|`['dcos-grid']['dcos_release_url']`|String|DC/OS download URL.|`'https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh'`|
-|`['dcos-grid']['dcos_cli_release_url']`|String|DC/OS CLI download URL (ver. 0.3.0 or later).|`'https://downloads.dcos.io/binaries/cli/linux/x86-64/0.4.10/dcos'`|
+|`['dcos-grid']['dcos_cli_release_url']`|String|DC/OS CLI download URL (ver. 0.3.0 or later).|`'https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.8/dcos'`|
+|`['dcos-grid']['dcos_cli_upgrade']`|Boolean|Whether upgrade DC/OS CLI or not (ver. 0.4.3 or later).|`false`|
|`['dcos-grid']['docker']['apt_repo']['url']`|String|DEPRECATED: use `['docker-grid']['apt_repo']['url']` (ver. 0.4.0 or later)|`nil`|
|`['dcos-grid']['docker']['apt_repo']['keyserver']`|String|DEPRECATED: use `['docker-grid']['apt_repo']['keyserver']` (ver. 0.4.0 or later)|`nil`|
|`['dcos-grid']['docker']['apt_repo']['recv-keys']`|String|DEPRECATED: use `['docker-grid']['apt_repo']['recv-keys']` (ver. 0.4.0 or later)|`nil`|
'dcos-grid' => {
'dcos_release_url' => 'https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh',
#'dcos_release_url' => 'https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh',
+ 'dcos_cli_release_url' => 'https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.8/dcos',
'bootstrap' => {
'ip' => '192.168.56.100',
'port' => '8080',
)
```
-- `roles/dcos-master.rb`
+- `roles/dcos0-master.rb`
```ruby
cluster_name = 'dcos0'
)
```
+- `roles/dcos0-cli.rb`
+
+```ruby
+cluster_name = 'dcos0'
+
+name "#{cluster_name}-cli"
+description "#{cluster_name} CLI setup"
+
+run_list(
+ "role[#{cluster_name}]",
+ 'recipe[dcos-grid::cli]',
+)
+
+override_attributes(
+ 'dcos-grid' => {
+ 'dcos_cli_upgrade' => true,
+ },
+)
+```
+
+### Upgrade DC/OS (ver. 0.4.3 or later)
+
+- Update attributes about DC/OS release URL (`['dcos-grid']['dcos_release_url']`) and configurations (`['dcos-grid']['bootstrap']['config']`).
+
+- execute `sudo chef-client` on each node.
+
+- upgrade the boostrap node.
+
+```
+$ /opt/dcos-grid/bootstrap_upgrade.sh
+```
+
+- upgrade each follower master node at first, and then upgrade the leader master node.
+
+```
+$ /opt/dcos-grid/node_upgrade.sh master
+```
+
+- upgrade each agent node.
+
+```
+$ /opt/dcos-grid/node_upgrade.sh {slave|slave_public}
+```
+
### Uninstall DC/OS
Please log in each node and execute the following.
#
default['dcos-grid']['dcos_release_url'] = 'https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh'
-default['dcos-grid']['dcos_cli_release_url'] = 'https://downloads.dcos.io/binaries/cli/linux/x86-64/0.4.10/dcos'
+default['dcos-grid']['dcos_cli_release_url'] = 'https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.8/dcos'
+default['dcos-grid']['dcos_cli_upgrade'] = false
# DEPRECATED: ['dcos-grid']['docker'][*] attributes. Use ['docker-grid'][*]
default['dcos-grid']['docker']['apt_repo'] = {
'url' => nil,
dns_search
master_dns_bindall
resolvers
+ use_proxy
+ http_proxy
+ https_proxy
+ no_proxy
+ check_time
docker_remove_delay
gc_delay
log_directory
oauth_enabled
oauth_issuer_url
oauth_client_id
+ dcos_overlay_enable
+ dcos_overlay_config_attempts
+ dcos_overlay_mtu
dcos_overlay_network
vtep_subnet
vtep_mac_oui
license 'Apache 2.0'
description 'Installs/Configures DC/OS Cluster Node.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version '0.4.2'
+version '0.4.3'
source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
issues_url 'https://osdn.jp/projects/metasearch/ticket'
supports 'ubuntu', '>= 16.04'
# external cookbooks
-depends 'docker-grid', '>= 0.2.0'
+depends 'docker-grid', '>= 0.2.1'
bash 'setup_private_agent_node' do
code <<-"EOH"
cd #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}
- ./node_setup.sh slave
+ ./node_setup.sh -y slave
EOH
not_if { ::Dir.exist?('/opt/mesosphere') }
end
else
log <<-"EOM"
-Note: You must execute the following command only once.
- $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh slave
+Note: You must execute the following command.
+ - Install (only once):
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh slave
+ - Upgrade:
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_upgrade.sh slave
EOM
end
mode '0755'
end
-template "#{File.dirname(genconf_dir)}/bootstrap_setup.sh" do
- source 'opt/dcos-grid/bootstrap_setup.sh'
- owner 'root'
- group 'root'
- mode '0755'
-end
+[
+ 'bootstrap_setup.sh',
+ 'bootstrap_upgrade.sh',
+].each {|script_file|
+ template "#{File.dirname(genconf_dir)}/#{script_file}" do
+ source "opt/dcos-grid/#{script_file}"
+ owner 'root'
+ group 'root'
+ mode '0755'
+ end
+}
log <<-"EOM"
Note: You must execute the following command manually.
- $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/bootstrap_setup.sh
+ - Install:
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/bootstrap_setup.sh
+ - Upgrade:
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/bootstrap_upgrade.sh
EOM
bash 'install_dcos_cli' do
code <<-"EOH"
- #{File.dirname(genconf_dir)}/cli_setup.sh
+ #{File.dirname(genconf_dir)}/cli_setup.sh -y
EOH
- not_if { ::File.exist?('/usr/local/bin/dcos') }
+ not_if { ::File.exist?('/usr/local/bin/dcos') } unless node['dcos-grid']['dcos_cli_upgrade']
end
bash 'setup_master_node' do
code <<-"EOH"
cd #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}
- ./node_setup.sh master
+ ./node_setup.sh -y master
EOH
not_if { ::Dir.exist?('/opt/mesosphere') }
end
else
log <<-"EOM"
-Note: You must execute the following command only once.
- $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh master
+Note: You must execute the following command.
+ - Install (only once):
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh master
+ - Upgrade:
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_upgrade.sh master
EOM
end
genconf_dir = node['dcos-grid']['bootstrap']['genconf_dir']
-template "#{File.dirname(genconf_dir)}/node_setup.sh" do
- source 'opt/dcos-grid/node_setup.sh'
- owner 'root'
- group 'root'
- mode '0755'
-end
+[
+ 'node_setup.sh',
+ 'node_upgrade.sh',
+].each {|script_file|
+ template "#{File.dirname(genconf_dir)}/#{script_file}" do
+ source "opt/dcos-grid/#{script_file}"
+ owner 'root'
+ group 'root'
+ mode '0755'
+ end
+}
bash 'setup_public_agent_node' do
code <<-"EOH"
cd #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}
- ./node_setup.sh slave_public
+ ./node_setup.sh -y slave_public
EOH
not_if { ::Dir.exist?('/opt/mesosphere') }
end
else
log <<-"EOM"
-Note: You must execute the following command only once.
- $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh slave_public
+Note: You must execute the following command.
+ - Install (only once):
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_setup.sh slave_public
+ - Upgrade:
+ $ #{File.dirname(node['dcos-grid']['bootstrap']['genconf_dir'])}/node_upgrade.sh slave_public
EOM
end
#!/usr/bin/env bash
+# https://dcos.io/docs/1.8/administration/installing/custom/advanced/
+# https://dcos.io/docs/1.7/administration/installing/custom/advanced/
+
PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
+usage() {
+ echo 'Usage: bootstrap_setup.sh [-y] [-h]'
+ echo 'This script sets up DC/OS bootstrap node.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
+}
+
+ARGS="$@"
+# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+echo 'This node will be set up as a Bootstrap node.'
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the setup? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Setup was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
user=`whoami`
sudo='sudo'
if [ $user = 'root' ]; then
sudo=''
fi
-cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>
+# Setup
+CMD='cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>'
+echo "Command: $CMD"
+$CMD
+
echo 'Downloading DC/OS release ...'
-$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>
+CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>"
+echo "Command: $CMD"
+$CMD
+
echo 'Generating DC/OS configurations ...'
-$sudo bash dcos_generate_config.sh
+CMD="$sudo bash dcos_generate_config.sh"
+echo "Command: $CMD"
+$CMD
+
echo 'Launching Docker container for the bootstrap service ...'
-$sudo docker run -d -p <%= node['dcos-grid']['bootstrap']['port'] %>:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx
+CMD="$sudo docker run -d -p <%= node['dcos-grid']['bootstrap']['port'] %>:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx"
+echo "Command: $CMD"
+$CMD
--- /dev/null
+#!/usr/bin/env bash
+
+# https://dcos.io/docs/1.8/administration/upgrading/
+# https://dcos.io/docs/1.7/administration/upgrading/
+
+PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
+
+usage() {
+ echo 'Usage: bootstrap_upgrade.sh [-y] [-h]'
+ echo 'This script upgrades DC/OS bootstrap node.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
+}
+
+ARGS="$@"
+# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+echo 'This node will be upgraded as a Bootstrap node.'
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the upgrade? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Upgrade was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
+user=`whoami`
+sudo='sudo'
+if [ $user = 'root' ]; then
+ sudo=''
+fi
+
+# Upgrade
+CMD='cd <%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>'
+echo "Command: $CMD"
+$CMD
+
+echo 'Downloading new DC/OS release ...'
+CMD="$sudo curl -O <%= node['dcos-grid']['dcos_release_url'] %>"
+echo "Command: $CMD"
+$CMD
+
+echo 'Generating new DC/OS configurations ...'
+CMD="$sudo bash dcos_generate_config.sh"
+echo "Command: $CMD"
+$CMD
+
+echo 'Disable Docker restarts in dcos_install.sh'
+CMD="$sudo sed -i -e 's/systemctl restart systemd-journald//g' -e 's/systemctl restart docker//g' genconf/serve/dcos_install.sh"
+echo "Command: $CMD"
+eval $CMD
+
+port=<%= node['dcos-grid']['bootstrap']['port'] %>
+if $sudo docker ps | grep "${port}->80"; then
+ echo 'Docker container for the bootstrap service is already running.'
+else
+ echo 'Launching Docker container for the bootstrap service ...'
+ CMD="$sudo docker run -d -p ${port}:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx"
+ echo "Command: $CMD"
+ $CMD
+fi
PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
+usage() {
+ echo 'Usage: cli_setup.sh [-y] [-h]'
+ echo 'This script sets up DC/OS client.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
+}
+
+ARGS="$@"
+# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+echo 'DC/OS client will be installed.'
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the install? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Install was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
user=`whoami`
sudo='sudo'
if [ $user = 'root' ]; then
sudo=''
fi
-$sudo curl <%= node['dcos-grid']['dcos_cli_release_url'] %> -o /usr/local/bin/dcos &&
+CMD="$sudo curl <%= node['dcos-grid']['dcos_cli_release_url'] %> -o /usr/local/bin/dcos &&
$sudo chmod +x /usr/local/bin/dcos &&
-$sudo dcos config set core.dcos_url https://<%= node['dcos-grid']['bootstrap']['config']['master_list'][0] %>
+$sudo /usr/local/bin/dcos config set core.dcos_url https://<%= node['dcos-grid']['bootstrap']['config']['master_list'][0] %>"
+echo "Command: $CMD"
+eval $CMD
# old way
#mkdir -p dcos && cd dcos &&
dcos_config = node['dcos-grid']['bootstrap']['config']
require 'yaml'
-yaml_str = YAML::dump(dcos_config.to_hash)
+#yaml_str = YAML::dump(dcos_config.to_hash)
+yaml_str = dcos_config.to_hash.to_yaml
-%>
<%= yaml_str %>
\ No newline at end of file
#!/usr/bin/env bash
+# https://dcos.io/docs/1.8/administration/installing/custom/advanced/
+# https://dcos.io/docs/1.7/administration/installing/custom/advanced/
+
PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
-help() {
- echo 'Usage: node_setup.sh {master,agent,slave,agent_public,slave_public}'
+usage() {
+ echo 'Usage: node_setup.sh [-y] [-h] {master,agent,slave,agent_public,slave_public}'
+ echo 'This script sets up DC/OS master or agent node.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
}
ARGS="$@"
-ROLE=$1
-
# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
if [ $# != 1 ]; then
- help
+ usage
exit 1
-elif [ $ROLE = '-h' ]; then
- help
- exit 0
+else
+ ROLE=$1
fi
case "$ROLE" in
ROLE='slave_public'
;;
* )
- help
+ usage
exit 1
;;
esac
echo "Node Role: $ROLE"
+echo "This node will be set up as a $ROLE node."
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the setup? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Setup was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
+# Setup
if [ -d /opt/mesosphere ]; then
echo -e '[ERROR] DC/OS is already installed.'
exit 1
fi
if [ ! -d /tmp/dcos ]; then
- mkdir /tmp/dcos
+ CMD='mkdir /tmp/dcos'
+ echo "Command: $CMD"
+ $CMD
fi
-cd /tmp/dcos
+CMD='cd /tmp/dcos'
+echo "Command: $CMD"
+$CMD
+
echo 'Downloading dcos_install.sh ...'
-curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh
-echo "Installing DC/OS $ROLE node ..."
-$sudo bash dcos_install.sh $ROLE
+CMD='curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh'
+echo "Command: $CMD"
+$CMD
+echo "Installing DC/OS $ROLE node ..."
+CMD="$sudo bash dcos_install.sh $ROLE"
+echo "Command: $CMD"
+$CMD
--- /dev/null
+#!/usr/bin/env bash
+
+# https://dcos.io/docs/1.8/administration/installing/custom/advanced/
+# https://dcos.io/docs/1.7/administration/installing/custom/advanced/
+
+PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
+
+exhibitor_storage_backend=<%= node['dcos-grid']['bootstrap']['config']['exhibitor_storage_backend'] %>
+
+usage() {
+ echo 'Usage: node_upgrade.sh [-y] [-h] {master,agent,slave,agent_public,slave_public}'
+ echo 'This script upgrades DC/OS master or agent node.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
+}
+
+ARGS="$@"
+# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+if [ $# != 1 ]; then
+ usage
+ exit 1
+else
+ ROLE=$1
+fi
+
+case "$ROLE" in
+ 'master' | 'slave' | 'slave_public' )
+ ;;
+ # aliases
+ 'agent' | 'agent_public' )
+ ROLE=${ROLE//agent/slave}
+ ;;
+ 'public_agent' | 'public-agent' )
+ ROLE='slave_public'
+ ;;
+ * )
+ usage
+ exit 1
+ ;;
+esac
+echo "Node Role: $ROLE"
+
+echo "This node will be upgraded as a $ROLE node."
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the upgrade? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Upgrade was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
+user=`whoami`
+sudo='sudo'
+if [ $user = 'root' ]; then
+ sudo=''
+fi
+
+if [ $ROLE = 'master' ]; then
+ zk_mode=`echo stat | /opt/mesosphere/bin/toybox nc localhost 2181 | grep "Mode:"`
+ echo "Zookeeper $zk_mode"
+
+ if echo $zk_mode | grep 'leader'; then
+ echo 'This node is Zookeeper leader. You should upgrade Zookeeper leader node at the end.'
+ while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the upgrade? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Upgrade was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+ done
+ fi
+fi
+
+# Upgrade
+if [ ! -d /tmp/dcos ]; then
+ CMD='mkdir /tmp/dcos'
+ echo "Command: $CMD"
+ $CMD
+fi
+CMD='cd /tmp/dcos'
+echo "Command: $CMD"
+$CMD
+
+echo 'Downloading new dcos_install.sh ...'
+CMD="$sudo curl -O <%= node['dcos-grid']['bootstrap']['config']['bootstrap_url'] %>/dcos_install.sh"
+echo "Command: $CMD"
+$CMD
+
+echo 'Uninstalling pkgpanda ...'
+CMD="$sudo -i /opt/mesosphere/bin/pkgpanda uninstall"
+echo "Command: $CMD"
+$CMD
+
+echo 'Removing data directory ...'
+CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere"
+echo "Command: $CMD"
+$CMD
+
+case "$ROLE" in
+ 'master' )
+ if [ $exhibitor_storage_backend != 'static' ]; then
+ 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"
+ echo "Command: $CMD"
+ $CMD
+ fi
+ ;;
+ 'slave' | 'slave_public' )
+<< "#__CO__"
+ # ???: If you have not made explicit disk size reservations, you must create
+ # a placeholder for the disk reservation file. This prevents the installer
+ # from building a new disk reservation file that might conflict with your
+ # stored agent metadata:
+ # $ sudo mkdir -p /var/lib/dcos
+ # $ sudo touch /var/lib/dcos/mesos-resources
+ CMD="$sudo mkdir -p /var/lib/dcos; $sudo touch /var/lib/dcos/mesos-resources"
+ echo "Command: $CMD"
+ $CMD
+#__CO__
+ ;;
+ * )
+ ;;
+esac
+
+echo 'Waiting for releasing of service ports ...'
+sleep 60s
+
+echo "Installing DC/OS $ROLE node ..."
+CMD="$sudo bash dcos_install.sh $ROLE"
+echo "Command: $CMD"
+$CMD
+
+case "$ROLE" in
+ 'master' )
+ cat << EOM
+Validate the upgrade
+ - Monitor the Exhibitor UI to confirm that the Master rejoins the ZooKeeper
+ quorum successfully (the status indicator will turn green). The Exhibitor
+ UI is available at http://<dcos_master>:8181/.
+ - Verify that curl http://<dcos_master_private_ip>:5050/metrics/snapshot has
+ the metric registrar/log/recovered with a value of 1.
+ - Verify that http://<dcos_master>/mesos indicates that the upgraded master
+ is running Mesos upgraded version.
+EOM
+ ;;
+ 'slave' | 'slave_public' )
+ cat << EOM
+Validate the upgrade
+ - Verify that curl http://<dcos_agent_private_ip>:5051/metrics/snapshot has
+ the metric slave/registered with a value of 1.
+ - Monitor the Mesos UI to verify that the upgraded node rejoins the DC/OS
+ cluster and that tasks are reconciled (http://<dcos_master>/mesos).
+EOM
+ ;;
+ * )
+ ;;
+esac
#!/usr/bin/env bash
+# https://dcos.io/docs/1.8/administration/installing/custom/uninstall/
+# https://dcos.io/docs/1.8/administration/installing/custom/uninstall/
+
PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`
+echo '[WARN] DC/OS does NOT support uninstall yet!'
+echo 'See https://dcos.io/docs/1.8/administration/installing/custom/uninstall/'
+
+usage() {
+ echo 'Usage: uninstall.sh [-y] [-h]'
+ echo 'This script uninstalls DC/OS.'
+ echo
+ echo "Options:"
+ echo " -h: this help."
+ echo " -y: always yes."
+ echo
+}
+
+ARGS="$@"
+# Validation
+while getopts 'yh' OPT; do
+ case $OPT in
+ 'y' )
+ always_yes=1
+ ;;
+ 'h' )
+ usage
+ exit 0
+ ;;
+ '?' )
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+echo 'DC/OS on this node will be uninstalled.'
+while true; do
+ if [ "$always_yes" = 1 ]; then
+ break
+ fi
+ echo -n 'Continue the uninstall? [y/N]: '
+ read answer
+ case $answer in
+ 'y' | 'yes' )
+ break
+ ;;
+ '' | 'n' | 'no' )
+ echo 'Uninstall was aborted by user.'
+ exit 0
+ ;;
+ * )
+ ;;
+ esac
+done
+
user=`whoami`
sudo='sudo'
if [ $user = 'root' ]; then
sudo=''
fi
+install_dir=<%= File.dirname(node['dcos-grid']['bootstrap']['genconf_dir']) %>
+
+# for Bootstrap node
+if ls $install_dir | grep 'dcos-genconf.*.tar'; then
+ CMD="$sudo rm ${install_dir}/dcos-genconf.*.tar"
+ echo "Command: $CMD"
+ $CMD
+fi
+
+if ls $install_dir | grep dcos_generate_config.sh; then
+ CMD="$sudo rm ${install_dir}/dcos_generate_config.sh"
+ echo "Command: $CMD"
+ $CMD
+fi
+
+# for Master and Agent nodes
pkgpanda=/opt/mesosphere/bin/pkgpanda
if [ -e "$pkgpanda" ]; then
echo 'Uninstalling DC/OS packages...'
- $sudo -i $pkgpanda uninstall
+ CMD="$sudo -i $pkgpanda uninstall"
+ echo "Command: $CMD"
+ $CMD
fi
if [ -e /opt/mesosphere ]; then
echo 'Remove /opt/mesosphere and /etc/mesosphere ...'
- $sudo rm -rf /opt/mesosphere /etc/mesosphere
+ CMD="$sudo rm -rf /opt/mesosphere /etc/mesosphere"
+ echo "Command: $CMD"
+ $CMD
fi
if [ -e /tmp/dcos ]; then
echo 'Remove /tmp/dcos ...'
- $sudo rm -rf /tmp/dcos
+ CMD="$sudo rm -rf /tmp/dcos"
+ echo "Command: $CMD"
+ $CMD
fi
+
+echo 'Uninstalled DC/OS successfully.'
)
override_attributes(
+ 'dcos-grid' => {
+ 'dcos_cli_upgrade' => true,
+ },
)
override_attributes(
'dcos-grid' => {
- 'dcos_release_url' => 'https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh',
#'dcos_release_url' => 'https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh',
+ 'dcos_release_url' => 'https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh',
+ # 1.8.6
+ #'dcos_release_url' => 'https://downloads.dcos.io/dcos/stable/commit/cfccfbf84bbba30e695ae4887b65db44ff216b1d/dcos_generate_config.sh',
+ # 1.7-open
+ #'dcos_release_url' => 'https://downloads.dcos.io/dcos/EarlyAccess/commit/14509fe1e7899f439527fb39867194c7a425c771/dcos_generate_config.sh',
+ 'dcos_cli_release_url' => 'https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.8/dcos',
'bootstrap' => {
'ip' => '192.168.56.100',
'port' => '8080',
'cluster_name' => cluster_name,
'master_list' => [
'192.168.56.101',
- #'192.168.56.102',
- #'192.168.56.103',
+ '192.168.56.102',
+ '192.168.56.103',
],
'resolvers' => [
'8.8.8.8',