본문 바로가기

개발 및 운영126

AWS NAT Instance 포트포워딩시 Source IP 유지하기 https://gist.github.com/jc-lab/b80aa4183c0f8c3971260ac2ee49443d AWS NAT Instance configure-pat.sh for Keep source ip AWS NAT Instance configure-pat.sh for Keep source ip - configure-pat.sh gist.github.com 기존에는 configure-pat.sh에 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 으로 되어있는데 이러면 내/외부 모든 패킷에 MASQUERADE가 적용되어 DNAT를 이용한 Port Forwarding시 Source IP가 NAT Instance의 IP으로 변하게 됩니다. 따라서 MySQL.. 2019. 10. 26.
AWS Lambda 기본 (삽질기) 요즘 AWS Lambda를 써보는데 기본적인 걸로 삽질을 했다..ㅋㅋ 1. VPC의 Subnet는 기본적으로 서로 통신이 가능하다. 삽질한 내용은 아니지만 기본적인 내용인데 인터넷을 보면 잘못 설명한 글이 몇몇 있었다. 한 VPC내의 모든 Subnet들은 라우터로 연결된 것으로 묘사되는데 서로 통신이 가능하단 뜻이다. 2. API Gateway이랑 연동할 때 Lambda에서 Timeout발생시 502 Bad Gateway가 뜬다. 3. Security Group는 Rule이 없으면 기본적으로 모든 Inbound를 거부한다. 4. Lambda를 VPC로 연결했을 때 기본적으로 AWS Service에 연결할 수 없다. 따라서 VPC에 Endpoint를 만들어서 외부 endpoint가 아닌 VPC 내부의 en.. 2019. 10. 24.
C++에서 Node.JS 사용하기 (node모듈아님) https://github.com/jc-lab/node-app jc-lab/node-app Embed node.js application with VFS(Virtual File System) - jc-lab/node-app github.com 삽질의 결과!ㅠㅠ 결과는 간단한데 과정이 힘들었음.. 2019. 10. 21.
Kubernetes 설치 Kubernetes Master Node 초기화 sysctl 수정 현재 Runtime에 대한 sysctl 변경 $ sudo sysctl net.bridge.bridge-nf-call-iptables=1 vim 으로 sysctl 에 대한 영구 설정 변경 $ sudo vim /etc/sysctl.d/99-sysctl.conf net.bridge.bridge-nf-call-iptables=1 # 추가 kubeadm $ sudo kubeadm init --pod-network-cidr=172.30.0.0/16 --service-cidr=10.244.0.0/16 마지막에 나오는 문장 기억해놓기 kubeadm join 10.0.0.2:6443 --token ssssss.asdasdasdas --discovery-t.. 2019. 9. 24.
[C++11] std::bind 로 unique_ptr 넘기기 될줄 알았죠? 안돼요...ㅠㅠ 이 글을 보면 해결책이 있을줄 알았죠? 없어요...^^ 최소한 C++ 자체 라이브러리 안에서는....ㅠㅠ 아래와 같이 따로 만들면은 됩니다! #include #include #include #include class Caller { public: virtual void run() = 0; }; template class Binder : public Caller { protected: F f_; std::size_t args_count_ = std::tuple_size::value; Tuple tuple_; public: Binder(F f, Tuple&& tuple) : f_(f), tuple_(std::move(tuple)) { std::cout 2019. 9. 4.
std::function 복사는 비싸다! 테스트코드 #include #include #include #include std::function temp_s; std::unique_ptr temp_u; void test_1() { for(int i=0; i 2019. 9. 4.
반응형