當cosbench的測試莫名其妙的terminated了,而且時而發生,時而不發生,mission log里也看不出什么信息,記得看一眼system log.
如果發現這個call stack, 那么請注意,很可能這次測試的失敗是由於controller和drivers與storage cluster 之間的時間不同步引起的。
2020-08-13 02:19:28,977 [ERROR] [AbstractAgent] - unexpected exception java.lang.ArrayIndexOutOfBoundsException: -9626 at com.intel.cosbench.bench.Counter.doAdd(Counter.java:65) at com.intel.cosbench.driver.model.OperatorContext.doAddSample(OperatorContext.java:76) at com.intel.cosbench.driver.model.OperatorContext.addSample(OperatorContext.java:70) at com.intel.cosbench.driver.agent.WorkAgent.onSampleCreated(WorkAgent.java:211) at com.intel.cosbench.driver.operator.Preparer.operate(Preparer.java:99) at com.intel.cosbench.driver.operator.AbstractOperator.operate(AbstractOperator.java:76) at com.intel.cosbench.driver.agent.WorkAgent.performOperation(WorkAgent.java:197) at com.intel.cosbench.driver.agent.WorkAgent.doWork(WorkAgent.java:177) at com.intel.cosbench.driver.agent.WorkAgent.execute(WorkAgent.java:134) at com.intel.cosbench.driver.agent.AbstractAgent.call(AbstractAgent.java:44) at com.intel.cosbench.driver.agent.AbstractAgent.call(AbstractAgent.java:1) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2020-08-13 02:19:28,977 [ERROR] [MissionHandler] - detected workers [19, 20, 21, 22, 23, 24] have encountered errors 2020-08-13 02:19:28,979 [INFO] [MissionHandler] - mission M2E66EA747D has been terminated |
當你在controller的system.log中發現如下的記錄,那么說明這次測試的terminate很可能是由於controller與drivers之間的時間不同步引起的。
2020-08-20 10:44:59,277 [WARN] [PingDriverRunner] - The driver driver1 at http://10.246.21.82:18088/driver is not reachable at the 1 time, with error message: Connection refused (Connection refused) 2020-08-20 17:47:37,351 [ERROR] [AbstractCommandTasklet] - driver report error: HTTP 400 - no such key defined: sizes 2020-08-20 17:47:37,359 [ERROR] [StageRunner] - detected tasks [t7, t8, t9, t10, t11, t12] have encountered errors 2020-08-20 17:47:37,366 [ERROR] [Aborter] - fail to abort driver |
進一步的排查,可以使用下面的命令,來讓controller和drivers同時返回本地時間,一邊讓時間的差距一目了然。如果不這么做,則很難明確幾台機器上的的時間差距是不是輸入間隔命令的那幾秒造成的。
# date && ssh root@10.246.21.82 date && ssh root@10.246.21.83 date
首先,確保controller與driver在同一個時區之內。
可以看到這台controller的時區是UTC,而我們應該改成與其他drivers一樣的New_York.
# timedatectl list-timezones | grep York
# timedatectl set-zimezone America/New_York
使用下面的命令來在CentOS 7上進行time sync.
先檢查NTP的狀態:
修改NTP的配置文件。
# vi /etc/ntp.conf
添加一條本地的NTP的服務器的信息,如下的兩行:
server 172.16.199.1
server 10.254.140.22
檢查ntp服務的狀態:
# systemctl status ntpd
舉例:
停掉ntp服務:
# systemctl stop ntpd
如果不停掉ntp服務的話,是沒辦法與服務器同步時間的。會報錯:”the NTP socket is in use, exiting”
檢查ntp服務的狀態:
強制時間與ntp服務器同步。
# ntpdate 10.254.140.22
或者
# ntpd -gq
下圖就是一個時間同步成功了之后的輸出。
或:
再啟動ntp服務。
# systemctl start ntpd.service
再檢查一下NTP服務的狀態,可以看到time已經sync了。
參考資料
==============
https://github.com/intel-cloud/cosbench/issues/264
https://www.thegeekdiary.com/centos-rhel-how-to-configure-ntp-server-and-client/
https://www.golinuxhub.com/2017/12/how-to-forcefully-sync-date-and-time/
https://www.thegeekdiary.com/centos-rhel-6-how-to-force-a-ntp-sync-with-the-ntp-servers/