linux项目常用命令

centos7

1、安装ntp服务软件包:yum install ntp

2、将ntp设置为缺省启动:systemctl enable ntpd

3、修改启动参数,增加-g -x参数,允许ntp服务在系统时间误差较大时也能正常工作:vi /etc/sysconfig/ntpd



4、启动ntp服务:service ntpd restart

5、将系统时区改为上海时间(即CST时区):ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

6、输入date命令查看时间是否正确
————————————————
版权声明:本文为CSDN博主「qq_37002521」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_37002521/article/details/81182625

  

1、chmod 777 文件夹名

给文件夹赋予所有权限,可以让别的系统推送文件过来。

2、无控制台启动项目

nohup java -jar cfdm-eureka-7001.jar > out.file 2>&1 &

3、修改环境变量

vim  /etc/profile

刷新环境变量

source /etc/profile

查看环境变量

env

4、centos7下找不到jps

yum install java-1.8.0-openjdk-devel.x86_64

5、yum安装源报错

# 备份原有repo文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 清理并重建缓存
sudo yum clean all
sudo yum makecache

 6、防火墙命令 

关闭防火墙的命令: systemctl stop firewalld

查看防火墙有没有关闭命令: systemctl status firewalld

 

7、传输命令

scp -r rocketmq-all-4.9.5-bin-release/ root@worker3:/home/xw/rocketmq

 

 8、更新虚拟机时间

centos7

1、安装ntp服务软件包:yum install ntp

2、将ntp设置为缺省启动:systemctl enable ntpd

3、修改启动参数,增加-g -x参数,允许ntp服务在系统时间误差较大时也能正常工作:vi /etc/sysconfig/ntpd



4、启动ntp服务:service ntpd restart

5、将系统时区改为上海时间(即CST时区):ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

6、输入date命令查看时间是否正确
————————————————
centos7

1、安装ntp服务软件包:yum install ntp

2、将ntp设置为缺省启动:systemctl enable ntpd

3、修改启动参数,增加-g -x参数,允许ntp服务在系统时间误差较大时也能正常工作:vi /etc/sysconfig/ntpd



4、启动ntp服务:service ntpd restart

5、将系统时区改为上海时间(即CST时区):ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

6、输入date命令查看时间是否正确

  

  

 

posted @ 2020-10-20 14:20  傲云萧雨  阅读(432)  评论(0)    收藏  举报