CentOS7 系统盘迁移

环境 两台服务器(A,B) A 已安装好 CentOS7,且已关闭 selinux B 裸机,待安装操作系统 打包根分区 从 B 上拆下系统硬盘,接在 A 上,启动 A 清空日志(推

CentOS7 安装 Cassandra 集群

环境 主机名 Public IP Cluster IP 操作系统 Cassandra 版本 cassandra101 10.0.4.101 10.10.10.101 CentOS7.6 3.0.18 cassandra102 10.0.4.102 10.10.10.102 CentOS7.6 3.0.18 cassandra103 10.0.4.103 10.10.10.103 CentOS7.6 3.0.18 下载 apache-cassandra-3.0.18-bin.tar.gz 各节点初始配置 关闭 selinux、防火墙 部署 java 运行环境 创建 cassandra 用户 1 useradd -m cassandra

sed 命令

流程 每次从输入中读取一行 匹配数据 修改数据 输出数据(默认 stdout) 选项 -e 执行多个编辑命令 1 2 sed -e 's/root/ROOT/g; s/bin/BIN/g' /etc/passwd sed -e 's/root/ROOT/g' -e 's/bin/BIN/g' /etc/passwd -f 从指定文件中获取 sed 命令 1 2 3 4 5 6

Xtrabackup 笔记

环境 CentOS7 MySQL 5.27.22 XtraBackup 2.4 安装 创建 percona.repo 文件,内容如下 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [percona-release-x86_64] name = Percona Original release/x86_64 YUM repository #baseurl = http://repo.percona.com/percona/yum/release/$releasever/RPMS/x86_64 baseurl = https://mirrors.cloud.tencent.com/percona/percona/yum/release/$releasever/RPMS/x86_64 enabled = 1 gpgcheck = 0 gpgkey = file:///etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY [percona-release-noarch] name = Percona Original release/noarch YUM

Nfs 笔记

环境 服务端 CentOS7 192.168.1.100 客户端 CentOS7 192.168.1.101 服务端 安装 1 2 3 4 yum install nfs-utils systemctl enable nfs-server systemctl start nfs-server # rpcbind 服务自动 start 并 enable 创建配置文件 1 2 3 4 5 mkdir /nfs_share -p chown -R nfsnobody.nfsnobody /nfs_share cat > /etc/exports.d/mynfs.conf <<EOF /nfs_share 192.168.1.0/24(rw,sync,all_squash) EOF 重新载入配置

CentOS7 安装 Postgresql

环境 CentOS 7 PostgreSQL 10.10 安装 安装 yum 源 1 2 3 4 5 6 7 8 yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # 或者从清华镜像站下载 yum install https://mirrors.tuna.tsinghua.edu.cn/postgresql/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # 可以更换成清华镜像站地址 sed -i 's,download.postgresql.org/pub,mirrors.tuna.tsinghua.edu.cn/postgresql,' /etc/yum.repos.d/pgdg-redhat-all.repo # 更新 yum 缓存 yum clean all yum makecache fast 安装 postgresql-server 1

awk 命令

格式 awk -F ‘分隔符正则’ -v 变量名=值 ‘BEGIN{动作} 条件{动作} END{动作}’ 文件1 文件

Openvpn 笔记

服务端配置文件 server.conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

Lvm 笔记

LVM 一览 LVM 结构 PE 物理扩展 PV 物理卷,在设备起始处放置一个标签,包括 uuid,lvm 配置元数据位置以及剩余空间 PV 可以由分区创建,也可以直接用磁盘创

CentOS7 yum 安装 Zabbix 4.4

环境 centos 7 nginx 1.16 php 7.2 zabbix 4.4 mysql 5.7 虚拟机 192.168.1.100 安装 nginx, php, mysql, zabbix-server, zabbix-agent 192.168.1.101 安装 zabbix-agent 导入软件源 只在 192.168.1.100 上操作 创建 /etc/yum.repos.d/epel.repo,内容如