cat /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf
cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf
上面都是查信息,这一步才是修改和操作
vi /etc/sysconfig/network-scripts/ifcfg-ens33
cd /etc/udev/rules.d/
vim 70-persistent-net.rules
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:50:56:3B:E1:CB",ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0"
重启一下使配置生效
reboot
ping一下 测一下能不能联网
ping baidu.com
hostnamectl set-hostname node1
hostname
cat /etc/sysconfig/network
HOSTNAME=node1
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.202.201 node1
192.168.202.202 node2
192.168.202.203 node3
systemctl stop iptables
systemctl stop firewalld
systemctl disable firewalld.service
将每台机器生成的id_rsa.pub追加添加到同一个authorized_keys内,然后再将该authorized_keys发送到其他远程主机上
ssh-keygen -t rsa
ssh-copy-id 192.168.202.201
scp -r ~/.ssh/authorized_keys 192.168.202.202:~/.ssh
scp -r ~/.ssh/authorized_keys 192.168.202.203:~/.ssh
为什么要时钟同步?
因为很多分布式系统是有状态的,比如存储一个数据,A节点记录的时间是1,B节点记录的时间是2,就会出很多问题
## 安装
yum install -y ntp
## 启动定时任务
crontab -e
*/1 * * * * /usr/sbin/ntpdate ntp.aliyun.com
每台主机都操作一次!
rpm -qa | grep java
##这里没有就不用卸载了
mkdir -p /export/softwares. #软件包存放目录
mkdir -p /export/servers #安装目录
这里先装一下rz工具,方便上传文件用
yum -y install lrzsz
# 上传jdk到/export/softwares路径下,并解压
tar -zxvf jdk-8u141-linux-x64.tar.gz -C ../servers/
tar -xvf jdk-8u141-linux-x64.tar.gz -C ../servers/
这里先装一下vim
yum -y install vim*
vim /etc/profile
在后面添加两行
export JAVA_HOME=/export/servers/jdk1.8.0_141
export PATH=:$JAVA_HOME/bin:$PATH
source /etc/profile
scp -r jdk1.8.0_141/ node2:$PWD
scp -r jdk1.8.0_141/ node3:$PWD
去除邮件提醒(每个机子都操作一遍)
还是刚才那个profile文件
# 添加一行
unset CHECKMAIL
yum install mysql mysql-server mysql-devel
# 依次运行这三个命令就行了
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
2.启动mysql服务
systemctl start mysqld
3.通过mysql安装自带脚本进行设置
/usr/bin/mysql_secure_installation
4.进入mysql的客户端并进行授权
mysql -u root -p
# 开放所有权限
grant all privileges on *.* to 'root'@'%' identified by '0102' with grant option;
flush privileges;