How to install mosh on an EMR master

714 Views Asked by At

I've been having issues with ssh connections terminating, and thought it might be better to install mosh on the emr master - this way there would be some protection from loss of connectivity. I've created the following script to act as part of my bootstrap, but when I run it, I'm having a few issues.

#!/bin/bash

#
# Make sure we've got git, autoconf, automake, protobuf-compilers
#

sudo yum install -y \
    git \
    autoconf-2.69-11.9.amzn1.noarch \
    automake-1.13.4-3.15.amzn1.noarch \
    protobuf-compiler-2.5.0-1.8.amzn1.x86_64 \
    protobuf-2.5.0-1.8.amzn1.x86_64

#
# Pull the latest code from github
#

cd /home/hadoop
git clone https://github.com/keithw/mosh

#
# Build and install
#

cd mosh
./autogen.sh && ./configure && make && sudo make install

Currently this falls over on the configure step with the following:

checking for protobuf... no
configure: error: Package requirements (protobuf) were not met:

No package 'protobuf' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

I've tried setting PREFIX=/usr and PKG_CONFIG_PATH=${PREFIX}/lib64/pkgconfig, then running ./configure with --prefix=$PREFIX - that doesn't help, I've also tried installing the 32 bit package, which also didn't help. This would all be easier if there were a source for sudo yum install -y mosh, however yum whatprovides mosh comes back empty.

Any pointers would be welcome!

1

There are 1 best solutions below

1
mr0re1 On

It depends on which version of AMI you make an installation. There is a changes you need to make to build it on AMI 3.7.0:

  • Do not specify particular version of protobuf package.

    There is protobuf version 2.5.0-1.10 on new AMIs

  • Additionally install package protobuf-devel

So your yum install command should look like this:

sudo yum install -y \
  git \
  autoconf-2.69-11.9.amzn1.noarch \
  automake-1.13.4-3.15.amzn1.noarch \
  protobuf-compiler \
  protobuf \
  protobuf-devel

UPD:

Don't forget to modify your ElasticMapReduce-master security group to open UDP port 60001.

  • Go to the AWS EC2 WebConsole / Network & Security / Security Groups;
  • Pick an ElasticMapReduce-master security group from a list;
  • Go to the Inbound tab and and a new rule for UDP port 6001.