This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Elastic Search on ec2 | |
ami: Ubuntu 11.10 Oneiric EBS boot Canonical ubuntu@ ami-a0ba68c9 | |
apt-get install: | |
openjdk-7-jdk | |
xfsprogs | |
htop | |
create new ebs (20gb), mount as sdf | |
mkfs.xfs /dev/xvdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread; | |
use std::net::SocketAddr; | |
use socket2::{Socket, Domain, Type}; | |
use std::net::Shutdown; | |
use std::sync::Arc; | |
fn main() { | |
let socket = Arc::new(Socket::new(Domain::ipv4(), Type::stream(), None).unwrap()); | |
socket.bind(&"127.0.0.1:8080".parse::<SocketAddr>().unwrap().into()).unwrap(); |