一、修改yum源

下载repo文件

  1. rm -f /etc/yum.repos.d/*
  2. curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  3. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  4. yum makecache

安装基本软件包

  1. yum -y install vim unzip net-tools curl gcc gcc-c++

关闭防火墙

  1. systemctl stop firewalld
  2. systemctl disable firewalld
  3. iptables -F
  4. sed -i 's/enforcing/disabled/' /etc/selinux/config
  5. setenforce 0

设置静态IP

  1. vim /etc/sysconfig/network-scripts/ifcfg-ens33
  2. BOOTPROTO="static"
  3. IPADDR="192.168.30.130"
  4. NETMASK="255.255.255.0"
  5. GATEWAY="192.168.30.2"
  6. DNS1="192.168.30.2"
  7. systemctl restart network

二、安装Docker

安装必要的一些系统工具

  1. yum install -y yum-utils device-mapper-persistent-data lvm2

添加软件源信息

  1. yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  2. sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo

更新并安装Docker-CE

  1. yum makecache
  2. yum -y install docker-ce

开启Docker服务

  1. systemctl start docker
  2. systemctl enable docker

配置镜像加速

  1. vim /etc/docker/daemon.json
  2. {
  3. "registry-mirrors": ["https://hrrn0cg9.mirror.aliyuncs.com"]
  4. }
  5. systemctl daemon-reload
  6. systemctl restart docker

三、安装Kubenetes

关闭swap

  1. swapoff -a

流量转发

  1. echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptables

添加软件源

  1. vim /etc/yum.repos.d/kubernetes.repo
  2. [kubernetes]
  3. name=Kubernetes
  4. baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
  5. enabled=1
  6. gpgcheck=1
  7. repo_gpgcheck=1
  8. gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg

安装k8s

  1. yum install -y kubelet kubeadm kubectl

启动k8s服务

  1. systemctl enable kubelet
  2. systemctl start kubelet

安装minikube

  1. curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
  2. rpm -Uvh minikube-latest.x86_64.rpm
  3. yum install -y conntrack

部署节点

  1. minikube start --image-mirror-country cn --registry-mirror=https://hrrn0cg9.mirror.aliyuncs.com --driver="none"

四、安装GitLab

添加软件源

  1. vim /etc/yum.repos.d/gitlab-ce.repo
  2. [gitlab-ce]
  3. name=Gitlab CE Repository
  4. baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
  5. gpgcheck=0
  6. enabled=1
  7. yum makecache

安装gitlab

  1. yum install -y gitlab-ce

修改访问路径

  1. vim /etc/gitlab/gitlab.rb

五、安装TeamCity

解压到指定目录

  1. tar zxvf TeamCity-2021.2.tar.gz -C /usr/local

六、安装服务器环境

6.1 JDK1.8

解压JDK

  1. tar zxvf jdk-8u311-linux-x64.tar.gz -C /usr/local/

配置环境变量/etc/profile

  1. vim /etc/profile
  2. #java1.8
  3. export JAVA_HOME=/usr/local/jdk1.8.0_311
  4. export PATH=$JAVA_HOME/bin:$PATH

6.2 Maven3.8.1

6.3 Oracle 11 XE

数据库下载地址:https://www.oracle.com/cn/database/technologies/express-edition.html

解压数据库

  1. unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

安装数据库

  1. cd Disk1
  2. rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm

初始化数据库

  1. /etc/init.d/oracle-xe configure

配置环境变量/etc/profile

  1. vim /etc/profile
  2. #oracle 11 xe
  3. export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
  4. export ORACLE_SID=XE
  5. export ORACLE_BASE=/u01/app/oracle
  6. export PATH=$ORACLE_HOME/bin:$PATH
  7. LSNR=$ORACLE_HOME/bin/lsnrctl
  8. SQLPLUS=$ORACLE_HOME/bin/sqlplus
  9. ORACLE_OWNER=oracle
  10. source /etc/profile

6.4 MySQL8.0

安装MySQL

  1. yum -y install mysql80-community-release-el7-3.noarch.rpm
  2. yum -y install mysql-community-server

配置服务

  1. systemctl start mysqld
  2. systemctl enable mysqld

修改默认密码

  1. grep 'temporary password' /var/log/mysqld.log
  2. mysql -uroot -p
  3. ALTER USER 'root'@'localhost' IDENTIFIED BY '1801Lzh#';
  4. CREATE USER 'root'@'%' IDENTIFIED BY '1801Lzh#';
  5. GRANT ALL ON *.* TO 'root'@'%';
  6. FLUSH PRIVILEGES;

6.5 Redis 6

安装redis

  1. tar zxvf redis-6.2.6.tar.gz -C /usr/local
  2. cd /usr/local/redis-6.2.6
  3. make install

注册服务

  1. mkdir /etc/redis
  2. mkdir -p /var/redis/6379
  3. cp utils/redis_init_script /etc/init.d/redis_6379
  4. cp redis.conf /etc/redis/6379.conf
  5. chkconfig redis_6379 on

修改配置文件

  1. vim /etc/redis/6379.conf
  2. bind 0.0.0.0
  3. daemonize yes