Search code examples
bashgoogle-cloud-platformdatastax-enterprisedatastax-startup

Running script for Wheezy customizations for DSE


I keep getting an error when trying to configure Datastax Enterprise (my first Cassandra cluster) on Google Cloud Platform, specifically when following the tutorial here: DataStax Enterprise Deployment Guide for Google Compute Engine - Manual

ssh into new machine called customizer

When I copy and paste the script, or completely retype the script on pico or vi (script found under "Create a customized OS image") and try to run it I get the error ./customizer.sh: line 21: syntax error near unexpected token 'newline' because of this line:

patch --backup /usr/share/google/safe_format_and_mount < #MOUNT_OPTIONS="discard,defaults" > MOUNT_OPTIONS="defaults,discard,noauto,noatime,barrier=0"
SFAM

Any idea what this line should look like to not get this error? When I try to remove the < and > the terminal gets hung up and i have to ctrl+c to get out.

Here is the full script:

#!/bin/bash

#This script can be applied to a running GCE instance
#to prep it for running DSE on SSD based storage, assumed
#to be mounted at /dev/sdb. After this script has been applied,
#a GCE image can be created accordin to the instructions at the
#Image creation guide: https://developers.google.com/compute/docs/images#creatingimage
#Base OS list: https://developers.google.com/compute/docs/operating-systems#backportsimages

apt-get update
apt-get install -y less htop patch libjna-java sysstat iftop binutils pssh pbzip2 zip unzip openssl curl liblzo2-dev ntp git python-pip tree unzip dstat ethtool

#Don't need to disable swap
#Disable Swap
#swapoff -a

#Need to mount SSD
mkdir -p /var/lib/cassandra
#https://developers.google.com/compute/docs/disks#formatting
#/usr/share/google/safe_format_and_mount -m "mkfs.ext4 -F"  
patch --backup /usr/share/google/safe_format_and_mount < #MOUNT_OPTIONS="discard,defaults"
> MOUNT_OPTIONS="defaults,discard,noauto,noatime,barrier=0"
SFAM

patch --backup /etc/rc.local < echo deadline > /sys/block/sdb/queue/scheduler
> echo 0 > /sys/block/sdb/queue/rotational
> blockdev --setra 0 /dev/sdb
> /usr/share/google/safe_format_and_mount -m "mkfs.ext4 -F" /dev/sdb /var/lib/cassandra
>
END

cat >> /etc/sysctl.conf <

Solution

  • Thanks for pointing this out and sorry for the inconvenience - this is actually an issue with our documentation. Some of the characters were stripped out when we moved to a new content management system. We are in the process of fixing this as soon as possible.

    In the meantime, please use this latest deployment guide for deploying Datastax Enterprise to Google: https://academy.datastax.com/demos/deployment-guide-google