Launching a Cluster |
For examples of common first-boot scripts, see the examples below.
The following script prints a test message to check that the first-boot scripts are running:
#!/bin/bash echo "Cluster Manager first-boot scripts are running."
Modify the default properties of the trapd service and remove the region check for your S3 bucket. This is mostly discouraged, but it can be useful if you are downloading data from public S3 buckets, where you are not permitted to verify the region of the bucket through the API. The following script can modifies the properties of trapd:
#!/bin/bash sed -i 's/#aspera.session.check-bucket.transfer=true/aspera.session.check-bucket.transfer=false/' /opt/aspera/etc/trapd/s3.properties
#!/bin/bash echo "/opt/aspera/bin/asnodeadmin -a -u xfer2 -x root -p node_api_password --acl-set impersonation" >> /opt/aspera/atcm/bin/configure-node-users.sh
#!/bin/bash sed -i 's/#aspera.session.support.symlink = false/aspera.session.support.symlink = true/' /opt/aspera/etc/trapd/s3.properties
#!/bin/bash Key=tag_name Value=tag_value Region=$(curl -sS http://169.254.169.254/2014-11-05/dynamic/instance-identity/document/ | jq --raw-output '.region') Instance=$(curl -sS http://169.254.169.254/latest/meta-data/instance-id) Volume=$(aws ec2 describe-instances --instance-ids $Instance --region $Region | jq --raw-output '.Reservations[].Instances[].BlockDeviceMappings[].Ebs.VolumeId') aws ec2 create-tags --resources $Volume --tags Key=$Key,Value=$Value --region $Region
The cluster connects to cloud storage using access keys, which provide a more secure and flexible alternative to authenticating with the Aspera node user or system user. For more information about access keys, see Access Key Overview.
Aspera recommends creating a new system user to use with all access keys. To create this system user, use the first-boot script and replace username with the desired name of your default user:
#!/bin/bash SYSTEM_USER=username function createUser() { local user=$1 groupadd -f aspusers adduser -s /bin/aspshell -G aspusers ${user} pushd /home/${user} mkdir -p .ssh cp -f /opt/aspera/var/aspera_id_dsa.pub .ssh/authorized_keys chown -R ${user}:${user} .ssh/ chmod 755 .ssh/ chmod 644 .ssh/authorized_keys popd } createUser "$SYSTEM_USER" echo " /opt/aspera/bin/asnodeadmin -d -u \"\$3\" /opt/aspera/bin/asnodeadmin -a -u \"\$3\" -x \"$SYSTEM_USER\" -p \"\$4\"" >> /opt/aspera/atcm/bin/configure-node-users.sh