Update: memcached has been added to amzn.repo, so 'yum install memcached' will do.
Here's a quick recipe for installing memcached on EC2 Amazon Linux AMI 1.0.
Memcached will be installed to /usr/local/bin. Let's make sure everything went well by running memcached:
Then we'll make sure it's running
And finally kill it.
The RPM will be created in ~/rpmbuild/RPMS/x86_64/ or ~/rpmbuild/RPMS/i386/ depending on whether you chose a 32 or 64 bit AMI. Copy the rpm to your home directory and run the command below to install memcached to /usr/bin/memcache
The beauty of this approach is that you can now do the following to start or stop memcached
And finally you can enable memcached at startup with this simple command:
Here's a quick recipe for installing memcached on EC2 Amazon Linux AMI 1.0.
yum install gcc libevent libevent-devel cd /usr/local/src wget http://memcached.org/latest tar -xf memcached-*.tar.gz cd memcached-* ./configure make && make install
/usr/local/bin/memcached -u root -d
ps aux | grep memcached
pkill memcached
Going all out - building a memcached rpm
If you're installing memcached on multiple machines then having an RPM handy is preferred. Make sure to run this as the ec2-user and not root.cd ~ sudo yum install gcc libevent libevent-devel rpm-build perl-Test-Base echo "%_topdir /home/ec2-user/rpmbuild" >> ~/.rpmmacros mkdir -p /home/ec2-user/rpmbuild/{SPECS,BUILD,SRPMS,RPMS,SOURCES} wget http://memcached.org/latest rpmbuild -ta memcached-*.tar.gz
sudo yum localinstall memcached-*.rpm --nogpgcheck
service memcached status service memcached start service memcached stop
chkconfig memcached on
http://www.developly.com/installing-memcached-on-amazon-linux-ami
No comments:
Post a Comment