@@ -85,33 +85,28 @@ if [ $rc -ne 0 ]; then
85
85
exit $rc
86
86
fi
87
87
88
- if [ -z " $CLUSTER " ]; then
89
- CLUSTER=false
90
- fi
88
+ CLUSTER=false
91
89
if ghe-ssh " $host " -- \
92
90
" [ -f '$GHE_REMOTE_ROOT_DIR /etc/github/cluster' ]" ; then
93
91
CLUSTER=true
94
92
fi
95
93
96
- set +e
97
94
# ensure all nodes in the cluster are online/reachable and running the same version
98
95
if " $CLUSTER " ; then
99
96
online_status=$( ghe-ssh " $host " ghe-cluster-host-check)
100
97
if [ " $online_status " != " Cluster is ready to configure." ]; then
101
- echo " $online_status " 1>&2
102
- log_error " Error: Not all nodes are online! Please ensure cluster is in a healthy state before using backup-utils." 1>&2
98
+ echo " Error: Not all nodes are online! Please ensure cluster is in a healthy state before using backup-utils." 1>&2
103
99
exit 1
104
100
fi
105
101
106
102
node_version_list=$( ghe-ssh " $host " ghe-cluster-each -- ghe-version)
107
103
distinct_versions=$( echo " $node_version_list " | awk ' {split($0, a, ":"); print a[2]}' | awk ' {print $4}' | uniq | wc -l)
108
104
if [ " $distinct_versions " -ne 1 ]; then
109
105
echo " Version mismatch: $node_version_list " 1>&2
110
- log_error " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
106
+ echo " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
111
107
exit 1
112
108
fi
113
109
fi
114
- set -e
115
110
116
111
version=$( echo " $output " | grep " GitHub Enterprise" | awk ' {print $NF}' )
117
112
@@ -120,37 +115,6 @@ if [ -z "$version" ]; then
120
115
exit 2
121
116
fi
122
117
123
- NON_WRITABLE=" "
124
- # ensure all nodes are writable
125
- if [ " $CLUSTER " == " true" ] ; then
126
- if [ -z " $GHE_FILE_SYSTEM_WRITE_CHECK " ]; then
127
- if [ -d " /data/user/tmp" ]; then
128
- WRITE_CHECK_FILE=" /data/user/tmp/test-ro-file.txt"
129
- else
130
- WRITE_CHECK_FILE=" /tmp/test-ro-file.txt"
131
- fi
132
- else
133
- WRITE_CHECK_FILE=" $GHE_FILE_SYSTEM_CHECK /test-ro-file.txt"
134
- fi
135
-
136
- # Iterate through each node in the cluster
137
- nodes=$( ghe-ssh " $host " ghe-cluster-nodes)
138
- for node in $nodes ; do
139
- if ! echo " set -o pipefail; ssh $node -- 'touch $WRITE_CHECK_FILE && rm $WRITE_CHECK_FILE '" | ghe-ssh " $host " /bin/bash; then
140
- echo " File system is not writeable or no permission on $node " 1>&2
141
- NON_WRITABLE+=" $node "
142
- fi || true
143
- done
144
- # Display the comma-separated list of non-writable nodes
145
- if [ -n " $NON_WRITABLE " ]; then
146
- NON_WRITABLE=$( echo " $NON_WRITABLE " | sed ' s/ /, /g; s/, $//' )
147
- log_error " Error: Following nodes are non-writable - $NON_WRITABLE . Please make sure the filesystem for all GHES nodes are writable." 1>&2
148
- exit 1
149
- else
150
- log_info " All nodes are writable."
151
- fi
152
- fi
153
-
154
118
# Block restoring snapshots to older releases of GitHub Enterprise Server
155
119
if [ -n " $GHE_RESTORE_SNAPSHOT_PATH " ]; then
156
120
snapshot_version=$( cat $GHE_RESTORE_SNAPSHOT_PATH /version)
@@ -213,7 +177,7 @@ SKIP_MSG
213
177
214
178
# Display dir requirements for repositories and mysql
215
179
echo -e " \nChecking host for sufficient space for a backup..."
216
- available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
180
+ available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
217
181
echo " We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time."
218
182
219
183
repos_disk_size=$( transfer_size repositories /tmp)
0 commit comments