- 环境要求
- 1. 与目标服务器相同系统版本的最小化安装环境
- 2. 此环境可以访问公网
- 配置 yum 源
- 1. CentOS-Base.repo 使用清华大学镜像
- 2. epel.repo 使用清华大学镜像
- 3. mysql.repo 使用清华大学镜像 5.6 版本
- 4.zabbix 使用阿里云镜像 4.0 版本
- 下载所有依赖的 rpm 包
- 1. 创建工作目录
- 2. 下载 rpm 包至 zabbix-repo/Packages 目录
- 3. 安装 createrepo ,并生成 yum 源
- 目标节点部署
- 1.将生成的 zabbix-repo 拷贝至目标节点 /var/zabbix-repo
- 2.配置本地 zabbix-local.repo
- 3.目标节点使用本地源进行 zabbix 部署
VersionMySQL5.6.XZabbix4.0.X
环境要求
1. 与目标服务器相同系统版本的最小化安装环境
2. 此环境可以访问公网
配置 yum 源
1. CentOS-Base.repo 使用清华大学镜像
[base] name=CentOS-$releasever - Base baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-$releasever - Updates baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [centosplus] name=CentOS-$releasever - Plus baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
2. epel.repo 使用清华大学镜像
[epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1
3. mysql.repo 使用清华大学镜像 5.6 版本
[mysql56-community] name=MySQL 5.6 Community Server baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql56-community-el7/ enabled=1 gpgcheck=0 [mysql57-community] name=MySQL 5.7 Community Server baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/ enabled=0 gpgcheck=0 [mysql80-community] name=MySQL 8.0 Community Server baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql80-community-el7/ enabled=0 gpgcheck=0 [mysql-connectors-community] name=MySQL Connectors Community baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-connectors-community-el7/ enabled=1 gpgcheck=0 [mysql-tools-community] name=MySQL Tools Community baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-tools-community-el7/ enabled=1 gpgcheck=0
4.zabbix 使用阿里云镜像 4.0 版本
[zabbix] name=Zabbix Official Repository - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/$basearch/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-debuginfo] name=Zabbix Official Repository debuginfo - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7//$basearch/debuginfo/ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 gpgcheck=0 [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=0
下载所有依赖的 rpm 包
1. 创建工作目录
# mkdir zabbix-repo
2. 下载 rpm 包至 zabbix-repo/Packages 目录
yum --downloadonly --downloaddir=zabbix-repo/Packages install mysql-community-server zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-java-gateway zabbix-proxy-mysql
3. 安装 createrepo ,并生成 yum 源
# yum install createrepo # ls zabbix-repo/ Packages # createrepo zabbix-repo Spawning worker 0 with 48 pkgs Spawning worker 1 with 48 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete # ls zabbix-repo/ Packages repodata
至此 zabbix-repo 即为包含 MySQL Zabbix 及其依赖的本地 yum 源
目标节点部署
1.将生成的 zabbix-repo 拷贝至目标节点 /var/zabbix-repo
2.配置本地 zabbix-local.repo
vi /etc/yum.repos.d/zabbix-local.repo [zabbix-local] name=Zabbix - Local baseurl=file:///var/zabbix-repo/ gpgcheck=0 enabled=1
3.目标节点使用本地源进行 zabbix 部署
# yum --disablerepo=* --enablerepo=zabbix-local install mysql-community-server zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
原文地址: https://www.xbases.org/article.html?id=QXJ0aWNsZU5vZGU6MTM%3D
From xbases.org