Coder Social home page Coder Social logo

lvbernardes / treinamento-devops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from didox/treinamento-devops

0.0 0.0 0.0 23.11 MB

HCL 16.30% Dockerfile 0.38% JavaScript 3.98% CSS 39.25% EJS 0.31% Java 3.23% Shell 2.68% HTML 29.04% Gherkin 0.10% Batchfile 0.01% Smarty 0.14% C# 1.15% SCSS 2.36% Go 0.02% TypeScript 0.61% Jupyter Notebook 0.37% Python 0.02% Ruby 0.05% Procfile 0.01%

treinamento-devops's Introduction

Link apostila: https://docs.google.com/document/d/1Pi9h1QXyBOhzm_9LYIWyWWcBZNFNJYc7_Aj6bA65Pyk/edit

Link apresentação: https://docs.google.com/presentation/d/1h81actx7ReWqXykzGhYJRuH_byCxALVL6MbLUvxxmmU/edit#slide=id.gf113ee1e2f_0_145

Instalar o AWS CLI

https://docs.aws.amazon.com/pt_br/cli/latest/userguide/install-cliv2.html

gerar um usuário no IAM aqui: https://console.aws.amazon.com/iamv2/home?#/groups/create Criar um security group e fazer download das chaves exemplo: professor.danilo_accessKeys.csv baixar o csv e colocar as informações da conta no configure do aws cli comando: aws configure

multiplos terminais

Iterm tilix https://gnunn1.github.io/tilix-web/

# ver os processos pela porta

sudo lsof -iTCP -sTCP:LISTEN -P | grep :5001

# ver os processos do node

ps aux | grep node

# matar ao processo com número PID

kill -9 PID

sudo su -

mysql -u root

use treinamento_database;

alter table usuarios add column email varchar(150);

alter table usuarios add column descricao text;

update usuarios set email='[email protected]' where id=1;

danilo

ssh -i chave.pem [email protected] -o ServerAliveInterval=60

load balancer user data

#!/bin/bash
apt update && apt upgrade -y
apt install net-tools nginx -y

cat <<EOF >> /etc/hosts
127.0.0.1 appservers
172.20.16.11 appserv1 ## substitua pelos ip privado do appserver1
172.20.63.249 appserv2 ## substitua pelos ip privado do appserver2
EOF

cat <<EOF > /etc/nginx/sites-available/default   
server {
    # Location that proxies requests to the upstream group
        location / {
            proxy_pass http://appservers;
        location /nginx_status {
                 stub_status;
                 allow 127.0.0.1;       #only allow requests from localhost
                 deny all;              #deny all other hosts
         }
         }
    }
EOF

cat <<EOF > /etc/nginx/nginx.conf 
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
}

http {


        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;


        include /etc/nginx/mime.types;
        default_type application/octet-stream;


        ssl_prefer_server_ciphers on;


        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;


        gzip on;



        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
   upstream appservers {
        server appserv1:8080;
        server appserv2:8080;
}
}
EOF

service nginx restart

treinamento-devops's People

Contributors

dependabot[bot] avatar didox avatar manoel1845 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.