静态配置ip如下:
server:
ip=172.25.x.11,gateway=172.25.x.254,dns1=172.25.254.254
desktop:
ip=172.25.x.10,gateway=172.25.x.254,dns1=172.25.254.254
desktop与server主机防火墙开启;
desktop与server主机selinux=enforcing;
desktop和server的yum源为http://172.25.254.254/rhel7.0/x86_64/dvd
确保以下操作在 desktop 和 server 主机重启后依然生效;
nm-connection-editor ##进入图形界面,设置网络
systemctl status firewalld ##查看防火墙状态
getenforce ##查看selinux状态
vim /etc/sysconfig/selinux ##selinux配置文件
reboot
vim /etc/yum.repos.d/rhel_dvd.repo
yum clean all
#1. server主机配置mariadb服务如下:
- 该服务阻断所有来自网络的tcp/ip连接,仅支持本地连接;
- 给数据库设置密码 fentiao ;
- 新建数据库 westosinfo ,该数据库中创建表 hostinfo ;
- hostinfo 表包含的字段为 ip 和 hostname ,表中插入3条记录(自己随便写);
- 创建用户 redhat 对 westosinfo 数据库的所有表只能查看不能修改;
yum reinstall mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
vim /etc/my.cnf
skip-networking=1 ###阻断监听
systemctl restart mariadb
netstat -antlpe | grep mysql
mysql_secure_installation ##第一次安装mysql以后通过这条命令可以对mysql进行设置
Enter current password for root (enter for none) 按Enter
Set root password? [Y/n] y
New password: fentiao
Re-enter new password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
mysql -uroot -p
Enter password:fentiao
MariaDB [(none)]> create database westosinfo;
MariaDB [(none)]> use westosinfo;
MariaDB [westosinfo]> create table hostinfo (
-> ip varchar(20) not null,
-> hostname varchar(50) not null);
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.1','server1.example.com');
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.2','server2.example.com');
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.3','server3.example.com');
MariaDB [westosinfo]> select * from hostinfo;
MariaDB [westosinfo]> create user redhat@localhost identified by "redhat";
MariaDB [westosinfo]> grant select on westosinfo.* to redhat@localhost;
mysql -uredhat -predhat -h localhost
#2. 配置链路聚合:
- 在desktop与server主机配置一链路,此链路使用 eth1 和 eth2;
- 此链路在一个接口失效时仍能正常工作;
- 此链路 serverx 使用ipv6地址 x:ac18::10a/64;
- 此链路 desktopx 使用ipv6地址 x:ac18::11b/64;
- 此链路在系统重启之后仍然保持正常状态。
[root@server31 ~]# nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip6 31:ac18::10a/64
[root@server31 ~]# nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
[root@server31 ~]# nmcli connection add con-name eth2 ifname eth2 type team-slave master team0
[root@server31 ~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
eth1
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
eth2
link watches:
link summary: up<
server:
ip=172.25.x.11,gateway=172.25.x.254,dns1=172.25.254.254
desktop:
ip=172.25.x.10,gateway=172.25.x.254,dns1=172.25.254.254
desktop与server主机防火墙开启;
desktop与server主机selinux=enforcing;
desktop和server的yum源为http://172.25.254.254/rhel7.0/x86_64/dvd
确保以下操作在 desktop 和 server 主机重启后依然生效;
nm-connection-editor ##进入图形界面,设置网络
systemctl status firewalld ##查看防火墙状态
getenforce ##查看selinux状态
vim /etc/sysconfig/selinux ##selinux配置文件
reboot
vim /etc/yum.repos.d/rhel_dvd.repo
yum clean all
#1. server主机配置mariadb服务如下:
- 该服务阻断所有来自网络的tcp/ip连接,仅支持本地连接;
- 给数据库设置密码 fentiao ;
- 新建数据库 westosinfo ,该数据库中创建表 hostinfo ;
- hostinfo 表包含的字段为 ip 和 hostname ,表中插入3条记录(自己随便写);
- 创建用户 redhat 对 westosinfo 数据库的所有表只能查看不能修改;
- redhat 用户的认证密码为 redhat
yum reinstall mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
vim /etc/my.cnf
skip-networking=1 ###阻断监听
systemctl restart mariadb
netstat -antlpe | grep mysql
mysql_secure_installation ##第一次安装mysql以后通过这条命令可以对mysql进行设置
Enter current password for root (enter for none) 按Enter
Set root password? [Y/n] y
New password: fentiao
Re-enter new password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
mysql -uroot -p
Enter password:fentiao
MariaDB [(none)]> create database westosinfo;
MariaDB [(none)]> use westosinfo;
MariaDB [westosinfo]> create table hostinfo (
-> ip varchar(20) not null,
-> hostname varchar(50) not null);
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.1','server1.example.com');
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.2','server2.example.com');
MariaDB [westosinfo]> insert into hostinfo values('172.25.31.3','server3.example.com');
MariaDB [westosinfo]> select * from hostinfo;
MariaDB [westosinfo]> create user redhat@localhost identified by "redhat";
MariaDB [westosinfo]> grant select on westosinfo.* to redhat@localhost;
mysql -uredhat -predhat -h localhost
#2. 配置链路聚合:
- 在desktop与server主机配置一链路,此链路使用 eth1 和 eth2;
- 此链路在一个接口失效时仍能正常工作;
- 此链路 serverx 使用ipv6地址 x:ac18::10a/64;
- 此链路 desktopx 使用ipv6地址 x:ac18::11b/64;
- 此链路在系统重启之后仍然保持正常状态。
[root@server31 ~]# nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip6 31:ac18::10a/64
[root@server31 ~]# nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
[root@server31 ~]# nmcli connection add con-name eth2 ifname eth2 type team-slave master team0
[root@server31 ~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
eth1
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
eth2
link watches:
link summary: up<