Advanced Search
Search Results
25 total results found
Portainer
Triển khai sử dụng docker compose file: # docker-compose.yml version: '3.9' services: portainer: image: portainer/portainer-ce:latest container_name: portainer restart: unless-stopped security_opt: - no-new-privileges:true ...
Cài đặt ban đầu cho server
Server CentOS 8: 8GB Ram, 16 cpu Cài docker # Cài docker yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin...
Deploy code production
Merge code từ nhánh dev về nhánh main. SSH vào server cd /home/doc5s/doc5s/code git fetch git pull # Nếu có thay đổi gì trong file .env thì vào sửa bằng tay vi api/.env.production vi client/.env.production docker-compose up -d --build docker ps ...
Export Excel dự án lên Share Drive của Google
Mục đích: Cứ đêm là export data của các dự án đang chạy ra file excel. File excel sẽ để ở Share Drive của Google. Viết bash chạy lệnh đưa file excel cũ vào thư mục archives, xuất file mới bằng script python có sẵn trong source code. ➜ api git:(main) ✗ c...
Tài liệu code
Tài khoản mặc định: admin/1q2w3E*
SSH
ssh-keygen -t ed25519 ssh-copy-id -i ~/.ssh/id_rsa.pub username@server_ip
setup
sudo apt install -y python3-pip pip3 install --user ansible echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc source ~/.bashrc ansible --version ## test ping ansible all --key-file ~/.ssh/ansible1 -i inventory -m ping ## content config ansible vi ...
ad-hoc commands
1. Apt update Chạy như này sẽ lỗi vì cần sudo để update change trong server ansible all -m apt -a update_cache=true Chạy bằng sudo ansible all -m apt -a update_cache=true --become --ask-become-pass 2. Cài package Ví dụ: Cài vim-nox ansible all -m apt -a...
playbook
1. Playbook install apache ansible-playbook install_apache.yaml --ask-become-pass install_apache.yaml --- - hosts: all become: true tasks: - name: update repo apt: update_cache: true - name: install apache apt: nam...
when
Mục đích Sử dụng when khi cần condition. Ví dụ như khi cần chạy lệnh riêng theo OS Của Host (Ubuntu, CentOS) Muốn biết key value của host thì lên doc xem hoặc chạy lệnh: ansible all -m gather_facts ansible all -m gather_facts | grep distri Trên terminal s...
Rút gọn playbook
Tạo biến trong file inventory 192.168.100.51 package_php="libapache2-mod-php" package_apache="apache2" 192.168.100.52 package_php="libapache2-mod-php" package_apache="apache2" 192.168.100.53 package_php="libapache2-mod-php" package_apache="apache2" 10.20.0...
Targeting Specific Nodes
1. Mục đích Chia host làm 3 nhóm web_servers: 192.168.100.51 và 192.168.100.54 (CentOS) db_servers: 192.168.100.52 file_servers: 192.168.100.53 Playbook bao gồm Update package toàn bộ host web server: cài apache và php db server: cài mariadb ...
Tài liệu
Design: C Mai: https://app.visily.ai/projects/50f87b16-42d4-4f56-9716-aad3ad28585a/boards/1194334 Hưng: https://www.figma.com/design/VoPc7O9LF0qSPkccucwLtN/Untitled?node-id=0-1&p=f Git: https://github.com/NguyenNghia412/sms_marketing Log dev: https...
Trao bằng
Màn chính: https://traobang.huce.edu.vn/guest/trao-bang/main-screen Màn phụ: https://traobang.huce.edu.vn/guest/trao-bang/side-screen
Cài đặt server dev
1. Server Rocky Linux 10.0 (Red Quartz) 8 vcpu, 8 Gb ram, 120 G
Install github runner
OS Rocky linux 10 Sau khi install github runner, bị lỗi permission denied runsvc.sh => Có khả năng do selinux => Thử disabled đi xong start lại service set selinux 0 sudo ./svc.sh stop sudo ./svc.sh start sudo ./svc.sh status Nếu status ok tức là do sel...
Monitor docker container log
Link github: https://github.com/amir20/dozzle Link hướng dẫn cài login vs user: https://dozzle.dev/guide/authentication Docker compose services: dozzle: container_name: dozzle image: amir20/dozzle:latest volumes: - /var/run/docker.s...
Cài đặt Prometheus + Grafana
1. Điều kiện Server linux: Đã cài docker 2. Cài Prometheus + Grafana 2.1 Các thành phần Service Mục đích Port Prometheus Thu thập metric bắn về từ các node exporter trên target 9090 Loki Sưu tầm log, nghe log từ promtail cài trên t...
Cấu hình Target
1. Node exporter Đây là 1 exporter cơ bản của một target (Server cần giám sát), chạy trên port 9100, cung cấp cho Prometheus các metric cơ bản (Ram, Cpu, disk, network,...) Chạy port 9100 1.1 Cài đặt trên linux # Tải file cài đặt và giải nén wget https://...
Alert Grafana
1. Cấu hình email Cấu hình mẫu cho email nằm trong /etc/grafana/grafana.ini [smtp] enabled = true host = email-smtp.ap-southeast-1.amazonaws.com:587 user = AKIAxxxxxxxxxxxx password = yourSMTPPasswordHere skip_verify = true from_address = your-email@ex...