Minio

Minio HOSTNAME IP node1 192.168.2.11 node2 192.168.2.12 Docker node1 docker-compose.yml services: minio: image: minio/minio:RELEASE.2024-06-13T22-53-53Z container_name: minio volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock - /mnt/da/minio/data1:/data1 - /mnt/db/minio/data2:/data2 environment: - TZ=Asia/Shanghai - MINIO_ROOT_USER=minio - MINIO_ROOT_PASSWORD=minio command: server http://node-{1...2}/data{1...2} --console-address ":19000" network_mode: host restart: always 启动 docker compose -f docker-compose.yml up -d node2 重复 node1

July 25, 2024 · Kevin

Nacos

Nacos HOSTNAME IP node1 192.168.2.11 node2 192.168.2.12 Docker node1 docker-compose.yml services: nacos: image: nacos/nacos-server:v2.3.2 container_name: nacos env_file: - /opt/nacos/conf/nacos.env volumes: - /etc/localtime:/etc/localtime:ro - /opt/nacos/conf:/home/nacos/conf - /opt/nacos/logs:/home/nacos/logs network_mode: host restart: always 获取 nacos 配置 从临时的容器中复制出来 临时容器名称 xxx 随机通过 docker ps 查看 docker run -it --entrypoint bash nacos/nacos-server:v2.3.2 docker cp xxx:/home/nacos/conf /opt/nacos nacos.env PREFER_HOST_MODE=hostname MODE=cluster # standalone 单机模式 cluster 集群 NACOS_SERVERS="node-1:8848 node-2:8848" SPRING_DATASOURCE_PLATFORM=mysql MYSQL_SERVICE_HOST=node-17 MYSQL_SERVICE_PORT=3316 MYSQL_SERVICE_DB_NAME=nacos MYSQL_SERVICE_USER=root MYSQL_SERVICE_PASSWORD=xxx 初始化数据库 启动 docker compose -f docker-compose....

July 25, 2024 · Kevin

Postgres

Postgres 主从模式 HOSTNAME IP master 192.168.2.11 replica 192.168.2.12 Docker master 创建目录赋权 mkdir -p /mnt/da/postgres/data chown 1000:1000 /mnt/da/postgres/data docker-compose.yml services: postgres: image: timescale/timescaledb-ha:pg16.3-ts2.15.1-all container_name: postgres volumes: - /etc/localtime:/etc/localtime:ro - /mnt/da/postgres/data:/var/lib/postgresql/data environment: - TZ=Asia/Shanghai - PGDATA=/var/lib/postgresql/data/pgdata - POSTGRES_PASSWORD=postgres network_mode: host restart: always 启动 docker compose -f docker-compose.yml up -d 修改 postgresql.conf listen_addresses = '*' max_connections = 1024 password_encryption = scram-sha-256 shared_buffers = 32GB work_mem = 8192kB maintenance_work_mem = 32GB effective_io_concurrency = 512 max_worker_processes = 256 max_parallel_workers_per_gather = 128 max_parallel_workers = 64 wal_level = replica synchronous_commit = off checkpoint_completion_target = 0....

July 25, 2024 · Kevin

Netplan

Netplan 静态 IP network: version: 2 renderer: NetworkManager ethernets: end0: dhcp4: false dhcp6: false addresses: - 192.168.2.x/24 routes: - to: 0.0.0.0/0 via: 192.168.2.1 nameservers: addresses: [192.168.2.1] link-local: [] # 禁用ipv6 多网口桥接上网 任意端口插入 wan 后另外一个端口可以用来给其他设备上网,建议设备里固定 ip 自动分配可能会有问题 开启 ipv4 转发 /etc/sysctl.conf net/ipv4/ip_forward=1 桥接 network: version: 2 renderer: NetworkManager ethernets: end0: dhcp4: false dhcp6: false end1: dhcp4: false dhcp6: false bridges: br0: dhcp4: false dhcp6: false interfaces: - end0 - end1 addresses: - 192....

June 15, 2024 · Kevin

Ubuntu 常见问题

Ubuntu 常见问题 修改时区 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime timedatectl set-timezone Asia/Shanghai 修改字符集 添加到 /etc/profile export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 关闭错误报告 修改 /etc/default/apport enabled=0 扩容磁盘 100% lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv 硬盘测速 # 写入 dd if=/dev/zero of=/test.img bs=5G count=1 oflag=direct # 读取 dd if=/test.img of=/dev/null bs=5G count=1 iflag=direct 内存测试 apt install mbw mbw -n 10 128 apt 代理 新建 /etc/apt/apt.conf.d/proxy.conf Acquire::http::Proxy "http://192.168.2.11:99"; Acquire::https::Proxy "http://192.168.2.11:99"; 硬盘挂载 修改/etc/fstab 添加如下, UUID 通过 blkid 查看 UUID=d2ff9ced-7f78-4b10-a088-558f79ccfb4b /mnt/da ext4 defaults,nofail 0 0

May 5, 2024 · Kevin