2023年11月

cat /dev/null > /etc/apt/sources.list

Debian 11 修改sources.list

cat <<EOT >> /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
  
deb http://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
  
deb http://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
  
deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
EOT

Debian 12 修改sources.list

cat <<EOT >> /etc/apt/sources.list
deb https://mirrors.aliyun.com/debian bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-updates main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
EOT

修改时区

1)sudo dpkg-reconfigure tzdata
2)timedatectl set-timezone Asia/Shanghai
3)echo Asia/Shanghai > /etc/timezone && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

安装常用工具

apt update
apt install -y procps telnet inetutils-ping net-tools vim wget
apt clean

Ubuntu修改时区

FROM ubuntu:latest
 
ENV TZ=Asia/Shanghai
 
RUN apt-get update && apt-get install -y tzdata
RUN echo ${TZ} > /etc/timezone && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && dpkg-reconfigure -f noninteractive tzdata

修改repositories

sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

修改时区

apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo Asia/Shanghai  > /etc/timezone
apk del tzdata

示例

FROM test.com/base/openjdk:8-jdk-alpine

ENV WORKSPACE=/app TZ=Asia/Shanghai

CMD mkdir ${WORKSPACE}
WORKDIR ${WORKSPACE}

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    apk --update add --no-cache ttf-dejavu fontconfig tzdata tini curl bash wget busybox-extras bind-tools tcpdump net-tools && \
    cp /usr/share/zoneinfo/${TZ} /etc/localtime && \
    echo ${TZ} > /etc/timezone && \
    rm -rf /var/cache/apk/*

COPY app.jar app.jar

EXPOSE 8080

CMD /sbin/tini -- java -Djava.security.egd=file:/dev/./urandom ${SW_AGENT_OPTS} ${JAVA_OPTS} -jar /app/app.jar ${SPRING_OPTS}

安装

yum groups install "X Window System"
yum groups install "GNOME Desktop"
systemctl set-default graphical.target

yum -y install tigervnc-server tigervnc
reboot

启动

cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
修改/etc/systemd/system/vncserver@:1.service中的用户名

systemctl daemon-reload
systemctl enable vncserver@:1
执行 vncpasswd 设置密码
systemctl start vncserver@:1

连接

https://www.realvnc.com/en/connect/download/viewer/
下载vnc viewer,地址栏中输入ip地址:1进行连接。

Installation

tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz
vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile

设置GoProxy

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

修改节点分片数

# 临时增加分片数(重启es会设置时效)
PUT /_cluster/settings
{
  "transient": {
    "cluster": {
      "max_shards_per_node":900000
    }
  }
}

# 永久增加分片数(推荐)
PUT /_cluster/settings
{
  "persistent": {
    "cluster": {
      "max_shards_per_node":900000
    }
  }
}