尝试在 Google Cloud Platform 上配置 Datastax Enterprise(我的第一个 Cassandra 集群)时,我一直收到错误消息,特别是在遵循此处的教程时: DataStax Enterprise Deployment Guide for Google Compute Engine - Manual
ssh
进入新机器称为customizer
当我复制并粘贴脚本,或完全重新键入脚本pico
或vi
(在“创建自定义操作系统映像”下找到的脚本)并尝试运行它时, ./customizer.sh: line 21: syntax error near unexpected token 'newline'
由于以下行而出现错误:
patch --backup /usr/share/google/safe_format_and_mount < #MOUNT_OPTIONS="discard,defaults" > MOUNT_OPTIONS="defaults,discard,noauto,noatime,barrier=0"
SFAM
知道这条线应该是什么样子才不会出现这个错误吗?当我尝试删除终端时<
,>
终端被挂断,我必须按 ctrl+c 才能退出。
这是完整的脚本:
#!/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 <