InvalidClaimException: The Token can‘t be used before

    1.最近测试环境出现许多用户多次登录才可成功的情况,查看两台测试环境日志,报错信息为InvalidClaimException: The Token can't be used before 某个时间,经排查分析,可能两台服务器的时间有差值,当在时间较快的服务器生成的token,去时间较慢的服务器验证token,就会出现上述错误,使用clockdiff 192.168.1.138检查两台服务器时间相差1秒多。

    2.解决办法就是同步服务器时间,第一通过ntp服务来同步,ntpdate -u XXX,前提是安装了ntp服务,可以通过nptdate -u ntp1.aliyun.com安装。第二可以通过手动设置,当然存在偏差,尽可能使用xshell工具,操作多台机器,发送一次命令 date -s 手动设置时间。

    3.ntp常用服务器
      国内:

cn.pool.ntp.org  中国开源免费NTP服务器
ntp1.aliyun.com 阿里云NTP服务器
ntp2.aliyun.com 阿里云NTP服务器
time1.aliyun.com 阿里云NTP服务器
time2.aliyun.com 阿里云NTP服务器

     国外:

time1.apple.com 苹果NTP服务器
time2.apple.com 苹果NTP服务器
time3.apple.com 苹果NTP服务器
time4.apple.com 苹果NTP服务器
time5.apple.com 苹果NTP服务器
time1.google.com 谷歌NTP服务器
time2.google.com 谷歌NTP服务器
time3.google.com 谷歌NTP服务器
time4.google.com 谷歌NTP服务器
pool.ntp.org 开源免费NTP服务器 

   4.ntpdate 命令

ntpdate -u cn.pool.ntp.org  :网络时间同步命令 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值