#改hostname
hostnamectl set-hostname localhost.localdomain
#启动监听
lsnrctl start
#停止监听
lsnrctl stop
#查看监听状态(是否开启)
lsnrctl status
#只允许某个IP访问流程:
vim /etc/hosts.allow
sshd:ip:allow
vim /etc/hosts.deny
sshd:ALL
service xinetd restart
#解压zip命令
unzip 压缩包全名
#把文件解压到某个目录里面
unzip 压缩包全名 -d /目录名字
#tar格式解压并移动到其他目录
tar -zxf 压缩包全名 -C /目录
#移动文件
mv 文件名 /路径
#文件夹改名
mv 文件名/ 名字
#查看防火墙状态
systemctl status firewalld
#永久关闭防火墙
systemctl stop firewalld.service
systemctl status firewalld.service
systemctl disable firewalld.service
#重启网卡服务
systemctl network restart
centos6:service network restart
#启动es服务
进入opt
source /etc/profile
./es793/bin/elasticsearch
./es793/bin/elasticsearch -d //后台运行服务
#启动eshead服务
进入eshead
npm run start
#启动kibana 进入kibana793
./bin/kibana
#启动logstash 进入bin
./logstash -f /opt/logstash793/config/logstash-sample.conf &
#启动filebeat 进入filebeat793
./filebeat -c filebeat.yml &
#ping不通域名但能ping通公网ip
修改dns配置文件
vim /etc/resolv.conf
nameserver:114.114.114.114
nameserver:8.8.8.8
#打开23端口,即telne
nc -lp 23 &
#上传本地服务器文件到远程机器指定目录
scp /etc/gitlab/gitlab.rb root@远程机器IP:/etc/gitlab
scp /etc/gitlab/gitlab-secrets.json root@远程机器IP:/etc/gitlab
/var/opt/gitlab/backups备份路径 //
/root/gitlabDataBackup远程服务器备份路径 //
#文件以m大小显示
ls -alh
#添加定时任务
crontab -e
0 3 * * * /root/auto_backup_to_remote.sh //凌晨三点执行2.203IP,root目录中的auto_backup_to_remote.sh脚本
0 4 * * * /root/gitlabDataBackup/auto_remove_old_backup.sh
#查看已执行定时任务
crontab -l
#重启crontab
systemctl restart crond