In general you can get a lot of instance metadata by accessing API on
http://169.254.169.254/latest/meta-data/
That includes instance id.
On generic Linux system, you can get the ID either using curl:
curl http://169.254.169.254/latest/meta-data/instance-id
or wget:
wget -q -O - http://169.254.169.254/latest/meta-data/instance-id
If you instance is based on Amazon Linux or have cloud-utils installed you can also run:
ec2-metadata -i
for instance id.
more documentation on metadata is a available here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
Provided by:Forthscale systems, cloud experts
Showing posts with label amazon. Show all posts
Showing posts with label amazon. Show all posts
Tuesday, February 26, 2019
Thursday, September 06, 2012
Setting up Amazon AWS EC2 ftp server with Linux and VSFTP:
Install vsftp (example for Ubuntu / Debian)
apt-get -y install vsftpd
Edit configuration file (in our example with local authentication and no guest user)
vi /etc/vsftpd.conf
write_enable=YES
anonymous_enable=NO
local_umask=022
local_enable=YES
#to add passive ftp:
pasv_enable=YES
pasv_max_port=12100
pasv_min_port=12000
port_enable=YES
pasv_address="your external instance ip or address"
and open inbound port range 20-21 and 12000-12100 in your security groups
Provided by: ForthScale systems, scalable infrastructure experts
apt-get -y install vsftpd
Edit configuration file (in our example with local authentication and no guest user)
vi /etc/vsftpd.conf
write_enable=YES
anonymous_enable=NO
local_umask=022
local_enable=YES
#to add passive ftp:
pasv_enable=YES
pasv_max_port=12100
pasv_min_port=12000
port_enable=YES
pasv_address="your external instance ip or address"
and open inbound port range 20-21 and 12000-12100 in your security groups
Provided by: ForthScale systems, scalable infrastructure experts
Sunday, February 19, 2012
Amazon AWS EC2 storage types
You can connect different storage types to Amazon EC2 instances, two of them provided naively by Amazon platform and the rest are either provided by external sources or tweaks. In any EC2 instance (except micro) you have instance storage included in a package. You can also use elastic block storage (EBS) and have an option connecting different 3rd party storage over the network.
Instance storage is a fast non-persistent storage provided by Amazon. It means it will revert to it`s original state after any system shutdown, erasing any changes you have applied to the file-system. It is very useful for running “dumb” servers that do not store data locally or as an additional storage for temporary files.
Elastic block storage (EBS) is a persistent storage provided by Amazon. All and any data stored on it is available after instance shutdown and can be manipulated with on device level. For example you can detach an EBS volume from one instance and attach it to another. However EBS can not be attached to more then once instance at the same time.
Using S3 as a file system. S3 is a storage infrastructure provided by Amazon as a service, it is not a part of EC2 (Elastic cloud) but can be used to store and retrieve any amount of data from anywhere at any time. Because S3 infrastructure is fully managed and scaled by Amazon it is very useful for large scale web projects, backup media and large volume data transfers. Using S3 as a file system is done via FUSE in Linux or as a mapped network drive in MS Windows. We are providing a tutorial on Linux implementation of S3 as a file system .
There are also few companies out there providing iSCSI storage arrays for AWS, one of them is Zadara storage, company providing Virtual Private Storage Arrays and currently in beta stage. iSCSI as any other network attached storage systems will incorporate persistence and availability of EBS at much faster speed.
Sunday, February 12, 2012
Setting Filezilla Server on Amazon EC2 instance with passive ftp
If you want to set Filezilla ftp server to handle passive connections on your AWS EC2 instances, you should do the following.
Select non used TCP ports, for example 9024-9048 range
Configure firewalls:
In your AWS EC2 security group, allow the incoming connections on chosen ports:
tcp port 20
tcp port 21
tcp port 9024-9048
If using Windows firewall on you instance, allow connections on same ports.
Now configure Filezilla to use specific port range on Passive connections:
Open Filezilla management console.
Got to: Edit > Settings > Passive Mode Settings
'External Server IP Address for passive mode transfers'
If you use AWS Elastic IP, enter it in "Use the following IP",
if not - use Filezilla provided web service with "Retrieve external IP address from" option.
Check 'Don't use external IP for local connections'
Check 'Use custom port range'
Enter chosen values (in our example) 9024 - 9048 for custom port range.
Powered by 123ContactForm | Report abuse
Provided by:SiQ systems, Cloud expertsThursday, April 07, 2011
How to update an auto scale launch configuration in Amazon EC
In order to update existing auto scale launch configuration in Amazon EC you need to create a new launch configuration using as-create-launch-config and then assign it to launch configuration using as-update-auto-scaling-group
Provided by:SiQ systems, Cloud experts
Provided by:SiQ systems, Cloud experts
Powered by 123ContactForm | Report abuse
Mounting S3 bucket as a file system on Linux (Ubuntu)
In order to mount S3 bucket on Linux you need to install ssh file system (FUSE) libraries first.
You can also add your bucket to /etc/fstab
s3fs#mybucket /mnt/s3 fuse allow_other,url=https://s3.amazonaws.com 0 0
Update for mounting S3 bucket on CentOS 5.5 and other old distros.
CentOS 5.5 comes with old FUSE version 2.7.4 as latest in it`s repository.
You need to manually compile version 2.8.4 befor you can use S3fs.
Remove old FUSE
yum remove fuse fuse* fuse-devel
Install needed libraries:
yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap
Download new FUSE from the Sourceforge:
wget "https://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz?r=&ts=1299709935&use_mirror=cdnetworks-us-1"
Untar and compile:
tar -xzvf fuse-2.8.4.tar.gz
cd fuse-2.8.4
./configure --prefix=/usr
make; make install
Configure FUSE in the system:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
modprobe fuse
Confirm that 2.8.4 is the version of FUSE displayed :
pkg-config --modversion fuse
Proceed with regular S3FS installation.
Have questions? Just contact us right away and we will be happy to assist
Install: aptitude install build-essential libcurl4-openssl-dev libxml2-dev libfuse-dev comerr-dev libfuse2 libidn11-dev libkadm55 libkrb5-dev libldap2-dev libselinux1-dev libsepol1-dev pkg-config fuse-utils sshfs
Follow the instantiations in S3fs WIKI:
It was using http download, not SVN.
Create a mount point for the new file system (ex. mkdir /mnt/s3)
Mount the file system:
ex.: s3fs tmpname -o use_cache=/tmp -o allow_other /mnt/s3
this mount comes with option of using a tmp as a cache for S3 content, you can clean that cache as you feel fit.
You can also add your bucket to /etc/fstab
s3fs#mybucket /mnt/s3 fuse allow_other,url=https://s3.amazonaws.com 0 0
Update for mounting S3 bucket on CentOS 5.5 and other old distros.
CentOS 5.5 comes with old FUSE version 2.7.4 as latest in it`s repository.
You need to manually compile version 2.8.4 befor you can use S3fs.
Remove old FUSE
yum remove fuse fuse* fuse-devel
Install needed libraries:
yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap
Download new FUSE from the Sourceforge:
wget "https://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz?r=&ts=1299709935&use_mirror=cdnetworks-us-1"
Untar and compile:
tar -xzvf fuse-2.8.4.tar.gz
cd fuse-2.8.4
./configure --prefix=/usr
make; make install
Configure FUSE in the system:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
modprobe fuse
Confirm that 2.8.4 is the version of FUSE displayed :
pkg-config --modversion fuse
Proceed with regular S3FS installation.
Have questions? Just contact us right away and we will be happy to assist
Subscribe to:
Posts (Atom)
2026. What I Actually Do Now
It’s been over 20 years of on-and-off dumping into this blog. 27 and going years in tech, more than 10 years around AI, going back to Heili ...
-
Following information is intended for bash shell only. The system variable TMOUT can be set to specify the amount of time the user is ina...
-
Amazon Elastic File System (Amazon EFS) is a scalable file storage for EC2 and services that run on EC2 (for example Kubernetes clusters). ...
-
To this day (8/8/2019) Terraform is not packaged in an official apt repository. There is an option to install it with Snap but be careful ...