思绪的空中生活

同步时间 解决v2ray 500错误
说明:这两天突然不能使用了,但是酸酸正常,重装无效。具体表现1.网站的nginx日志2019/02/09 14:5...
扫描右侧二维码阅读全文
09
2019/02

同步时间 解决v2ray 500错误

说明:这两天突然不能使用了,但是酸酸正常,重装无效。

具体表现

1.网站的nginx日志

2019/02/09 14:57:38 [error] 3472#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.132.40, server: 域名, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:25534/", host: "域名"

2.v2ray日志

2019/02/09 14:59:47 127.0.0.1:50462 rejected  v2ray.com/core/proxy/vmess/encoding: invalid user

搜索了下,可能和系统时间有关。

3.查看时间
date
显示的时间果然不对,快了2分钟。

同步时间

适用于 debian

apt-get install -y ntp
vi /etc/ntp.conf #修改为下面几行
server 0.debian.pool.ntp.org iburst dynamic
server 1.debian.pool.ntp.org iburst dynamic
server 2.debian.pool.ntp.org iburst dynamic
server 3.debian.pool.ntp.org iburst dynamic
/etc/init.d/ntp restart #重启

强制 NTP 重新同步
如果 ntpdate 不可用,可以尝试以下方式让 ntpd 强制同步:

systemctl stop ntpsec
ntpd -gq  # 允许大时间偏移并同步
systemctl start ntpsec

-g 选项允许 NTP 服务器调整大偏差时间(默认不超过 1000 秒)。
-q 选项让它在同步后退出,而不是作为守护进程运行。

centos 同步时间

在 CentOS 中同步时间可以使用 chrony 或 ntp 服务。CentOS 7 及以上推荐使用 chrony,而 CentOS 6 主要使用 ntp。

使用 chrony(CentOS 7/8)

1. 安装 chrony(如果未安装)
yum install -y chrony

2. 启动 chronyd 服务并设置开机自启
systemctl start chronyd
systemctl enable chronyd

3. 手动同步时间
chronyc sources -v  # 查看 NTP 服务器状态
chronyc tracking     # 查看系统时间跟踪状态

4. 立即同步
chronyc makestep

5. 验证同步后的时间
date

相关文章:

  • Qv2ray使用教程
  • anyhk nat 食用指南
  • 安利个v2ray pud.life
  • 宝塔 v2ray 腾讯云cdn 联通免流
  • 老毛子配置v2ray
  • Last modification:March 29th, 2025 at 10:28 pm
    If you think my article is useful to you, please feel free to appreciate

    4 comments

    1. sailor

      解决了 但是不知道为啥,时区不对突然不能用了,前段时间还是可以的

    2. NoName

      干得漂亮!

      1. sss
        @NoName

        我本来连着没有500错误的,就是连上不能访问google和youtube,然后一群人都说是系统时间,结果改了系统时间就出现了500错误

        1. 思绪的空中生活
          @sss

          那你把时间改回来啊,访问不了可能是dns的问题

    Leave a Comment