时间同步(通过配置ntp达到时间同步的目的
1、在虚拟机上检查ntp包是否安装
命令: rpm -qa|grep ntpd
如图所示,说明有ntp包
如果没有就下载:yum -y install ntp
2、修改配置文件
修改 /etc/ntp.conf
这里我使用的上海交大的同步时间
3、重启ntp服务
service ntpd restart
4、设置为开机自启
chkconfig ntpd on
永久关闭防火墙
1.首先查看防火墙状态:
service iptables status
永久性生效,重启后不会复原
开启:
chkconfig iptables on
关闭:
chkconfig iptables off
即时生效,重启后复原
开启:
service iptables start
关闭:
service iptables stop
关闭selinux
查看SELinux状态:
1./usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态,图片显示的没有开启
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2.修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
安装lzsz
yum install -y lrzsz
查看对应目录下各个文件磁盘的占用大小
du -h | grep G
查看某个进程是否在运行
ps -ef | grep zookeeper
将某个压缩包解压到指定目录
tar -zxvf -C /export/service/
查看指定目录某个字母在哪里
find .|xargs grep -ri “vc”
查看某目录下有多少个文件命令
find DirPath -type f | wc -l
比如: find /home/snail -type f | wc -l
linux中查看一个文本文件有多少行
wc -l 文件名