CPU:2核↑,内存:4GB↑
开发工具:eclipse-jee、MySQL Workbench、MobaXterm、Redis Insight...
操作系统:CentOS Stream 9(生产环境)、Windos 11 + Ubuntu 22.04.3(开发环境)
- MySQL 8.4.1 LTS
1.安装
# 下载安装包
wget
https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-8.4.1-linux-glibc2.28-x86_64.tar.xz
# 解压
tar xvf mysql-8.4.1-linux-glibc2.28-x86_64.tar.xz
mv /usr/local/mysql-8.4.1-linux-glibc2.28-x86_64 /usr/local/mysql
vi /etc/profile
# 添加配置
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile
2.初始化
yum install -y libaio
mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize
可以看到初始密码为Ns9jsuty>R!x
- 启动
vi /usr/local/mysql/support-files/mysql.server
# 找到 $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null & wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# 在$bindir/mysqld_safe 后方,--datadir="$datadir"前方增加 --user=root这个参数
/usr/local/mysql/support-files/mysql.server start
mysql -u root -p
- 创建远程账户
# 修改root密码
alter user 'root'@'localhost' identified by '******';
# 创建新账户并授权
# CREATE USER 'admin'@'%' IDENTIFIED BY '******';
# GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';
# 允许root账户远程登录
use mysql;
update user set host='%' where user = 'root';
flush privileges;
- 配置mysql开机自动启动
cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/
chkconfig mysql.server on
- JDK 17
# 下载安装包
wget
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
tar xvf jdk-17_linux-x64_bin.tar.gz
mv /usr/local/jdk-17.0.12 /usr/local/jdk
vi /etc/profile
export PATH=$PATH:/usr/local/jdk/bin
source /etc/profile
- Nginx
1.安装
wget http://nginx.org/download/nginx-1.27.0.tar.gz
tar xvf nginx-1.27.0.tar.gz
cd nginx-1.27.0/
yum install pcre pcre-devel
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
2.启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
- 配置nginx开启自动启动
vim /lib/systemd/system/nginx.service
[Unit]
Description=nginx service
After=network.target
[Service]
# 后台运行
Type=forking
# 启动指令
ExecStart=/usr/local/nginx/sbin/nginx
# 重启指令
ExecReload=/usr/local/nginx/sbin/nginx -s reload
# 强制退出指令
ExecStop=/usr/local/nginx/sbin/nginx -s quit
# 给服务分配独立的临时空间
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl enable nginx
- Redis
- 下载安装包wget http://download.redis.io/releases/redis-7.2.5.tar.gz
cp /mnt/e/redis-7.2.5.tar.gz /usr/local/
tar xzf redis-7.2.5.tar.gz
cd redis-7.2.5
# 编译
make
# 安装
make install
mkdir /usr/local/redis
cp /usr/local/redis-7.2.5/src/redis-server /usr/local/redis
cp /usr/local/redis-7.2.5/src/redis-cli /usr/local/redis
cp /usr/local/redis-7.2.5/redis.conf /usr/local/redis
cd /usr/local/redis
2.修改配置文件
vi redis.conf
#绑定0.0.0.0表示可以远程或本地连接,且不受IP限制
bind 0.0.0.0
#默认端口,可以改成别的端口
port 6379
#守护进程设置为yes
daemonize yes
#redis主库库的访问密码
requirepass ******
- 启动
sysctl vm.overcommit_memory=1
./redis-server redis.conf
./redis-cli
auth ******
4.配置redis开机自动启动
#将redis-7.2.5/utils文件夹下的redis_init_script文件复制到/etc/init.d/路径下
# cp /usr/local/redis-7.2.5/utils/redis_init_script /etc/init.d/
cp /usr/local/redis-7.2.5/utils/redis_init_script /etc/rc.d/init.d/
#编辑redis的开机启动文件,修改配置文件位置,找到
vi /etc/rc.d/init.d/redis_init_script
CONF="/etc/redis/${REDISPORT}.conf"
改为
CONF="/usr/local/redis/redis.conf"
chmod +x /etc/rc.d/init.d/redis_init_script
# 设置redis的开机自启服务
yum install chkconfig
chkconfig redis_init_script on
- Minio
1.下载
wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio
- 启动
chmod +x minio
MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=minioadmin nohup ./minio server /mnt/data --console-address ":9001" >/dev/null 2>&1 &
默认账户:minioadmin/minioadmin
3.配置minio开机自动启动
vim /etc/systemd/system/minio.service
[Unit]
Description=MinIO Server
Documentation=https://docs.min.io
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/minio server /mnt/data --console-address ":9001"
Restart=always
Environment="MINIO_ROOT_USER=minioadmin" "MINIO_ROOT_PASSWORD=minioadmin"
[Install]
WantedBy=multi-user.target
systemctl enable minio
CPU:8核↑,内存:16GB↑
# 临时关闭防火墙
systemctl stop firewalld
# 关闭防火墙
systemctl disable firewalld
# 临时关闭swap分区
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
# 临时关闭SELinux
setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
CPU:8核↑,内存:16GB↑
# 更新系统
yum update -y
# 临时关闭防火墙
systemctl stop firewalld
# 关闭防火墙
systemctl disable firewalld
# 临时关闭swap分区
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
# 临时关闭SELinux
setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
- Docker 基于操作系统层级的虚拟化技术,将软件与其依赖项打包为容器
yum install yum-utils.noarch -y
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 列出可用的docker-ce(社区版)版本
yum list docker-ce --showduplicates | sort -r
# 指定版本安装
yum install docker-ce-24.0.9-1.el9 -y
vi /etc/docker/daemon.json
{
"exec-opts": [ "native.cgroupdriver=systemd" ],
"registry-mirrors": ["https://docker.1panel.live"]
}
# 启动docker服务
sudo systemctl start docker
docker version
sudo systemctl enable docker
- OnlyOffice 可在线文档编辑器
docker run -i -t -d -p 80:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver
- Milvus是一款云原生向量数据库,能够帮助用户轻松应对海量非结构化数据(图片/视频/语音/文本)检索
wget https://github.com/milvus-io/milvus/releases/download/v2.3.1/milvus-standalone-docker-compose.yml -O docker-compose.yml
sudo docker compose up -d
docker port milvus-standalone 19530/tcp
# 安装milvus图形化管理工具
docker run -d --name=attu -p 8000:3000 -e MILVUS_URL=服务器ip:19530 zilliz/attu:v2. 3.1
- Kubernetes 一个用于管理容器化应用和服务集群的开源平台
# 配置kubernetes下载源
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
# 安装kubelet、kubeadm、kubectl
yum install kubelet-1.23* kubeadm-1.23* kubectl-1.23* -y
# [ERROR CRI]: container runtime is not running
# 修改配置文件,注释 # disabled_plugins = ["cri"]
vi /etc/containerd/config.toml
# 重启containerd
systemctl restart containerd
kubeadm reset
yum install kubelet-1.23* kubeadm-1.23* kubectl-1.23* -y
systemctl enable kubelet --now
# 查看安装的版本
kubeadm version
kubectl version
kubelet --version
# 查看kubeadm初始化集群需要的镜像
kubeadm config images list
# 下载kubernetes相关镜像
kubeadm config images pull --image-repository registry.aliyuncs.com/google_containers
# kubeadm reset
kubeadm init --image-repository registry.aliyuncs.com/google_containers
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /etc/profile
source /etc/profile
kubectl get nodes