Uploading to server
This commit is contained in:
BIN
BI Process.bpm
Normal file
BIN
BI Process.bpm
Normal file
Binary file not shown.
35
Install K8s/masternode.sh
Normal file
35
Install K8s/masternode.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
apt update - y
|
||||||
|
apt upgrade -y
|
||||||
|
sudo swapoff -a
|
||||||
|
nano /etc/fstab
|
||||||
|
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
|
||||||
|
overlay
|
||||||
|
br_netfilter
|
||||||
|
EOF
|
||||||
|
sudo modprobe overlay
|
||||||
|
sudo modprobe br_netfilter
|
||||||
|
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
|
||||||
|
net.bridge.bridge-nf-call-iptables = 1
|
||||||
|
net.bridge.bridge-nf-call-ip6tables = 1
|
||||||
|
net.ipv4.ip_forward = 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
cat /proc/sys/net/ipv4/ip_forward
|
||||||
|
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
||||||
|
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install kubeadm kubelet kubectl
|
||||||
|
sudo apt-mark hold kubeadm kubelet kubectl
|
||||||
|
sudo apt-get install -y containerd
|
||||||
|
sudo mkdir /etc/containerd
|
||||||
|
containerd config default | sudo tee /etc/containerd/config.toml
|
||||||
|
nano /etc/containerd/config.toml
|
||||||
|
|
||||||
|
kubeadm config images pull
|
||||||
|
export KUBECONFIG=/etc/kubernetes/admin.conf
|
||||||
|
kubeadm init --pod-network-cidr=10.244.0.0/16
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
|
||||||
|
mkdir -p $HOME/.kube
|
||||||
|
cp etc/kubernetes /admin.conf $HOME/.kube/config
|
||||||
|
|
31
Install K8s/workernode.sh
Normal file
31
Install K8s/workernode.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
apt update - y
|
||||||
|
apt upgrade -y
|
||||||
|
sudo swapoff -a
|
||||||
|
nano /etc/fstab
|
||||||
|
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
|
||||||
|
overlay
|
||||||
|
br_netfilter
|
||||||
|
EOF
|
||||||
|
sudo modprobe overlay
|
||||||
|
sudo modprobe br_netfilter
|
||||||
|
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
|
||||||
|
net.bridge.bridge-nf-call-iptables = 1
|
||||||
|
net.bridge.bridge-nf-call-ip6tables = 1
|
||||||
|
net.ipv4.ip_forward = 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
cat /proc/sys/net/ipv4/ip_forward
|
||||||
|
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
|
||||||
|
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install kubeadm kubelet kubectl
|
||||||
|
sudo apt-mark hold kubeadm kubelet kubectl
|
||||||
|
sudo apt-get install -y containerd
|
||||||
|
sudo mkdir /etc/containerd
|
||||||
|
containerd config default | sudo tee /etc/containerd/config.toml
|
||||||
|
nano /etc/containerd/config.toml
|
||||||
|
scp root@192.168.1.156:/etc/kubernetes/admin.conf /etc/kubernetes/admin.conf
|
||||||
|
mkdir -p $HOME/.kube
|
||||||
|
cp etc/kubernetes/admin.conf $HOME/.kube/config
|
||||||
|
|
48
Install Redash/docker-compose.yml
Normal file
48
Install Redash/docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:5
|
||||||
|
container_name: redash-redis
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
redash-server:
|
||||||
|
image: redash/redash:10.1.0.b50633
|
||||||
|
container_name: redash-server
|
||||||
|
command: server
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
|
||||||
|
REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
|
||||||
|
REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
|
||||||
|
REDASH_REDIS_URL: "redis://redash-redis:6379/0"
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
redash-scheduler:
|
||||||
|
image: redash/redash:10.1.0.b50633
|
||||||
|
container_name: redash-scheduler
|
||||||
|
command: scheduler
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
|
||||||
|
REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
|
||||||
|
REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
|
||||||
|
REDASH_REDIS_URL: "redis://redash-redis:6379/0"
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
redash-worker:
|
||||||
|
image: redash/redash:10.1.0.b50633
|
||||||
|
container_name: redash-worker
|
||||||
|
command: worker
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
|
||||||
|
REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
|
||||||
|
REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
|
||||||
|
REDASH_REDIS_URL: "redis://redash-redis:6379/0"
|
||||||
|
restart: always
|
47
Jupyterhub/install_jupyterhub.sh
Normal file
47
Jupyterhub/install_jupyterhub.sh
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "🔧 Cập nhật hệ thống..."
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
|
||||||
|
echo "🧹 Gỡ Node.js & npm cũ nếu còn..."
|
||||||
|
sudo apt purge -y nodejs npm libnode-dev || true
|
||||||
|
sudo apt autoremove -y
|
||||||
|
sudo rm -rf /usr/lib/node_modules /usr/include/node /usr/share/node* ~/.npm ~/.nvm
|
||||||
|
|
||||||
|
echo "📦 Cài Node.js 18 từ NodeSource..."
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||||
|
sudo apt install -y nodejs
|
||||||
|
|
||||||
|
echo "🧪 Kiểm tra Node.js & npm:"
|
||||||
|
node -v
|
||||||
|
npm -v
|
||||||
|
|
||||||
|
echo "🌐 Cài configurable-http-proxy..."
|
||||||
|
sudo npm install -g configurable-http-proxy
|
||||||
|
|
||||||
|
echo "🐍 Cài Python và công cụ phát triển..."
|
||||||
|
sudo apt install -y python3 python3-pip python3-venv python3-dev build-essential git
|
||||||
|
|
||||||
|
echo "📁 Tạo thư mục và môi trường ảo cho JupyterHub..."
|
||||||
|
sudo mkdir -p /opt/jupyterhub
|
||||||
|
sudo chown $USER /opt/jupyterhub
|
||||||
|
cd /opt/jupyterhub
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
echo "📦 Cài đặt JupyterHub và Notebook..."
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install jupyterhub notebook
|
||||||
|
|
||||||
|
echo "⚙️ Tạo file cấu hình JupyterHub..."
|
||||||
|
jupyterhub --generate-config
|
||||||
|
|
||||||
|
echo "✅ Hoàn tất. Bạn có thể chỉnh sửa cấu hình tại:"
|
||||||
|
echo " /opt/jupyterhub/jupyterhub_config.py"
|
||||||
|
echo
|
||||||
|
echo "👉 Để chạy thử:"
|
||||||
|
echo " cd /opt/jupyterhub"
|
||||||
|
echo " source venv/bin/activate"
|
||||||
|
echo " jupyterhub"
|
14
Jupyterhub/jupyterhub.service
Normal file
14
Jupyterhub/jupyterhub.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=JupyterHub
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# Không nên dùng root nếu không cần thiết. Nếu vẫn dùng root, đảm bảo bảo mật hệ thống.
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=/opt/jupyterhub
|
||||||
|
Environment="PATH=/opt/jupyterhub/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
ExecStart=/opt/jupyterhub/venv/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
29
Jupyterhub/jupyterhub/jupyterhub_config.py
Normal file
29
Jupyterhub/jupyterhub/jupyterhub_config.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
c = get_config()
|
||||||
|
|
||||||
|
# Cấu hình xác thực PAM
|
||||||
|
c.Authenticator.use_pam = True
|
||||||
|
c.Authenticator.allowed_users = {'cuongpv', 'pvcuong', 'root', 'cdh'}
|
||||||
|
c.Authenticator.admin_users = {'cuongpv'}
|
||||||
|
c.Authenticator.allow_existing_users = True
|
||||||
|
|
||||||
|
# Sử dụng PAM Authenticator
|
||||||
|
c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'
|
||||||
|
|
||||||
|
# Tăng thời gian chờ của kernel và websocket
|
||||||
|
c.MappingKernelManager.kernel_info_timeout = 300
|
||||||
|
c.MappingKernelManager.kernel_startup_timeout = 300
|
||||||
|
c.NotebookApp.websocket_ping_interval = 60
|
||||||
|
c.NotebookApp.tornado_settings = {
|
||||||
|
"websocket_ping_interval": 60
|
||||||
|
}
|
||||||
|
|
||||||
|
# ⚠️ QUAN TRỌNG: Thêm cấu hình proxy để fix lỗi Terminal không hoạt động
|
||||||
|
c.ConfigurableHTTPProxy.command = [
|
||||||
|
'configurable-http-proxy',
|
||||||
|
'--ip', '127.0.0.1', # Nếu bạn muốn proxy lắng nghe từ ngoài thì thay bằng '0.0.0.0'
|
||||||
|
'--port', '8000',
|
||||||
|
'--api-ip', '127.0.0.1',
|
||||||
|
'--api-port', '8001',
|
||||||
|
'--error-target', 'http://127.0.0.1:8081/hub/error',
|
||||||
|
'--log-level', 'info'
|
||||||
|
]
|
BIN
Oracle/oracle.png
Normal file
BIN
Oracle/oracle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
PostgreSQL_vs_MariaDB_for_Moodle.pdf
Normal file
BIN
PostgreSQL_vs_MariaDB_for_Moodle.pdf
Normal file
Binary file not shown.
BIN
Thue dich vu CNTT.docx
Normal file
BIN
Thue dich vu CNTT.docx
Normal file
Binary file not shown.
BIN
huong dan cai dat superset.docx
Normal file
BIN
huong dan cai dat superset.docx
Normal file
Binary file not shown.
BIN
huong_dan_docker_firewalld.docx
Normal file
BIN
huong_dan_docker_firewalld.docx
Normal file
Binary file not shown.
21
pgloader/elearning.load
Normal file
21
pgloader/elearning.load
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
LOAD DATABASE
|
||||||
|
FROM mysql://root:HP_LE1851w@192.168.1.140/elearning
|
||||||
|
INTO postgresql://postgres:HP_LE1851w@192.168.1.140:5432/elearning
|
||||||
|
|
||||||
|
WITH include no drop,
|
||||||
|
create tables,
|
||||||
|
create indexes,
|
||||||
|
reset sequences
|
||||||
|
|
||||||
|
CAST
|
||||||
|
type tinyint when (= precision 1) to smallint drop typemod,
|
||||||
|
type smallint to smallint drop typemod,
|
||||||
|
type int to integer drop typemod,
|
||||||
|
type integer to integer drop typemod,
|
||||||
|
type datetime to timestamptz drop default drop not null,
|
||||||
|
type date to date
|
||||||
|
|
||||||
|
SET work_mem TO '16MB',
|
||||||
|
maintenance_work_mem TO '512MB',
|
||||||
|
search_path TO 'public'
|
||||||
|
;
|
21
pgloader/english.load
Normal file
21
pgloader/english.load
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
LOAD DATABASE
|
||||||
|
FROM mysql://root:HP_LE1851w@192.168.1.140/english
|
||||||
|
INTO postgresql://postgres:HP_LE1851w@192.168.1.140:5432/english
|
||||||
|
|
||||||
|
WITH include no drop,
|
||||||
|
create tables,
|
||||||
|
create indexes,
|
||||||
|
reset sequences
|
||||||
|
|
||||||
|
CAST
|
||||||
|
type tinyint when (= precision 1) to smallint drop typemod,
|
||||||
|
type smallint to smallint drop typemod,
|
||||||
|
type int to integer drop typemod,
|
||||||
|
type integer to integer drop typemod,
|
||||||
|
type datetime to timestamptz drop default drop not null,
|
||||||
|
type date to date
|
||||||
|
|
||||||
|
SET work_mem TO '16MB',
|
||||||
|
maintenance_work_mem TO '512MB',
|
||||||
|
search_path TO 'public'
|
||||||
|
;
|
21
pgloader/linkvnonline.load
Normal file
21
pgloader/linkvnonline.load
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
LOAD DATABASE
|
||||||
|
FROM mysql://root:HP_LE1851w@192.168.1.140/linkvnonline
|
||||||
|
INTO postgresql://postgres:HP_LE1851w@192.168.1.140:5432/linkvnonline
|
||||||
|
|
||||||
|
WITH include no drop,
|
||||||
|
create tables,
|
||||||
|
create indexes,
|
||||||
|
reset sequences
|
||||||
|
|
||||||
|
CAST
|
||||||
|
type tinyint when (= precision 1) to smallint drop typemod,
|
||||||
|
type smallint to smallint drop typemod,
|
||||||
|
type int to integer drop typemod,
|
||||||
|
type integer to integer drop typemod,
|
||||||
|
type datetime to timestamptz drop default drop not null,
|
||||||
|
type date to date
|
||||||
|
|
||||||
|
SET work_mem TO '16MB',
|
||||||
|
maintenance_work_mem TO '512MB',
|
||||||
|
search_path TO 'public'
|
||||||
|
;
|
Reference in New Issue
Block a user