Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit 97f6fbb

Browse files
authored
Merge pull request #35 from gruntwork-io/libtinfo-fix
Fix swappiness typo. Fix libtinfo issue on Amazon Linux.
2 parents 6ff67ab + 3f85390 commit 97f6fbb

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

modules/install-couchbase-server/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Options:
5959
--version The version of Couchbase to install. Default: 5.1.0.
6060
--checksum The checksum of the Couchbase package. Required if --version is specified. You can get it from the downloads page of the Couchbase website.
6161
--checksum-type The type of checksum in --checksum. Required if --version is specified. Must be one of: sha256, md5.
62-
--swapiness The OS swapiness setting to use. Couchbase recommends setting this to 0. Default: 0.
62+
--swappiness The OS swappiness setting to use. Couchbase recommends setting this to 0. Default: 0.
6363
6464
Example:
6565
@@ -90,7 +90,7 @@ Install the following:
9090

9191
### Update swap settings
9292

93-
Set the "swapiness" setting on your OS to 0. See [Swap Space and Kernel
93+
Set the "swappiness" setting on your OS to 0. See [Swap Space and Kernel
9494
Swappiness](https://developer.couchbase.com/documentation/server/current/install/install-swap-space.html) for details.
9595

9696

modules/install-couchbase-server/install-couchbase-server

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ readonly DEFAULT_COUCHBASE_COMMUNITY_MD5_CHECKSUM_AMAZON_LINUX="1c2bfda713f93991
3131
readonly SHA256_CHECKSUM_TYPE="sha256"
3232
readonly MD5_CHECKSUM_TYPE="md5"
3333

34-
readonly DEFAULT_SWAPINESS="0"
35-
readonly SWAPINESS_CONFIG_FILE="/etc/sysctl.conf"
34+
readonly DEFAULT_SWAPPINESS="0"
35+
readonly SWAPPINESS_CONFIG_FILE="/etc/sysctl.conf"
3636
readonly DISABLE_THP_BOOT_SCRIPT="/etc/init.d/disable-thp"
3737

3838
readonly DEFAULT_COUCHBASE_DIR="/opt/couchbase"
@@ -53,7 +53,7 @@ function print_usage {
5353
echo -e " --version\t\tThe version of Couchbase to install. Default: $DEFAULT_COUCHBASE_ENTERPRISE_VERSION."
5454
echo -e " --checksum\t\tThe checksum of the Couchbase package. Required if --version is specified. You can get it from the downloads page of the Couchbase website."
5555
echo -e " --checksum-type\tThe type of checksum in --checksum. Required if --version is specified. Must be one of: $SHA256_CHECKSUM_TYPE, $MD5_CHECKSUM_TYPE."
56-
echo -e " --swapiness\t\tThe OS swapiness setting to use. Couchbase recommends setting this to 0. Default: $DEFAULT_SWAPINESS."
56+
echo -e " --swappiness\t\tThe OS swappiness setting to use. Couchbase recommends setting this to 0. Default: $DEFAULT_SWAPPINESS."
5757
echo
5858
echo "Example:"
5959
echo
@@ -118,6 +118,10 @@ function install_couchbase_on_amazon_linux {
118118

119119
log_info "Cleaning up $filepath"
120120
rm -f "$filepath"
121+
122+
# Workaround for https://github.com/gruntwork-io/terraform-aws-couchbase/issues/33
123+
log_info "Creating symlink for libtinfo"
124+
sudo ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so.5
121125
}
122126

123127
# Disabling transparent huge pages is recommended for Couchbase servers.
@@ -127,14 +131,14 @@ function disable_transparent_huge_pages {
127131
sudo cp "$SCRIPT_DIR/disable-thp" "$DISABLE_THP_BOOT_SCRIPT"
128132
}
129133

130-
# A swapiness of 0 or 1 is recommended for Couchbase servers.
134+
# A swappiness of 0 or 1 is recommended for Couchbase servers.
131135
# https://developer.couchbase.com/documentation/server/current/install/install-swap-space.html
132-
function update_swapiness {
133-
local readonly swapiness="$1"
136+
function update_swappiness {
137+
local readonly swappiness="$1"
134138

135-
log_info "Updating OS swapiness settings to $swapiness in $SWAPINESS_CONFIG_FILE"
139+
log_info "Updating OS swappiness settings to $swappiness in $SWAPPINESS_CONFIG_FILE"
136140

137-
file_replace_or_append_text "^vm.swappiness.*=.*$" "vm.swapiness = $swapiness" "$SWAPINESS_CONFIG_FILE"
141+
file_replace_or_append_text "^vm.swappiness.*=.*$" "vm.swappiness = $swappiness" "$SWAPPINESS_CONFIG_FILE"
138142
}
139143

140144
function install_couchbase_scripts {
@@ -166,7 +170,7 @@ function install {
166170
local version
167171
local checksum
168172
local checksum_type
169-
local swapiness="$DEFAULT_SWAPINESS"
173+
local swappiness="$DEFAULT_SWAPPINESS"
170174

171175
while [[ $# > 0 ]]; do
172176
local key="$1"
@@ -194,9 +198,9 @@ function install {
194198
checksum_type="$2"
195199
shift
196200
;;
197-
--swapiness)
201+
--swappiness)
198202
assert_not_empty "$key" "$2"
199-
swapiness="$2"
203+
swappiness="$2"
200204
shift
201205
;;
202206
--help)
@@ -243,7 +247,7 @@ function install {
243247
exit 1
244248
fi
245249

246-
update_swapiness "$swapiness"
250+
update_swappiness "$swappiness"
247251
disable_transparent_huge_pages
248252
install_couchbase_scripts "$DEFAULT_COUCHBASE_BIN_DIR"
249253
install_couchbase_commons "$COUCHBASE_COMMONS_SRC_DIR" "$COUCHBASE_COMMONS_INSTALL_DIR"

0 commit comments

Comments
 (0)