没有不值得去解决的问题,也没有不值得去学习的技术!

Analyzing and Resolving NAS Storage Mount Failures

In Rancher scheduling, add a scheduling rule.

1. In the Rancher volumes, add: /webtv:/data. As shown in Figure 1.

In the Rancher volumes, add: /webtv:/data.
Figure 1

2. Check the container logs; the error is: LOG_NAME: unbound variable. As shown in Figure 2.

Check the container logs; the error is: LOG_NAME: unbound variable.
Figure 2
Plaintext
2020/8/3 下午4:40:16/config/init/cronlog.sh: line 5: LOG_NAME: unbound variable
2020/8/3 下午4:40:19sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
2020/8/3 下午4:40:19bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
2020/8/3 下午4:40:19/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

3. Enter the container and check the directory listing under /data; it does not meet expectations. The mount was unsuccessful. As shown in Figure 3.

Enter the container and check the directory listing under /data; it does not meet expectations. The mount was unsuccessful.
Figure 3
Plaintext

[root@955ea658d009 data]# ls -l
total 24
drwxr-xr-x 2 root root 4096 Apr 29 15:27 cmclogs
drwx--x--x 2 root root 4096 Jun 28 11:31 conf
drwxr-xr-x 2 root root 4096 Apr 21 16:13 log-static
drwx--x--x 2 root root 4096 Jun 28 11:31 logs
drwx--x--x 2 root root 4096 Jun 28 11:31 run
drwxr-xr-x 6 root root 4096 Jun 28 12:42 wangjie

4. In Rancher scheduling, add a scheduling rule. As shown in Figure 4.

In Rancher scheduling, add a scheduling rule.
Figure 4

5. After upgrading again, enter the container and check the directory listing under /data; it meets expectations. The NAS storage was mounted successfully. As shown in Figure 5.

After upgrading again, enter the container and check the directory listing under /data; it meets expectations. The NAS storage was mounted successfully.
Figure 5
Plaintext

[root@08dfcc44c6e2 /]# cd /data/
[root@08dfcc44c6e2 data]# ls -l
total 3485844
drwxr-xr-x  2 root              root                6 Sep  6  2019 96
drwxr-xr-x  3        4294967294 4294967294         24 Apr 10  2019 BSAudit
drwxr-xr-x  3 root              root               26 Jul  9  2019 ForPublic
drwxr-xr-x  4 root              root               30 Dec 26  2018 SRS
-rw-r--r--  1 root              root         14107659 May 14 10:08 catalina.out.2020-05-14.log
drwxrwxrwx  3 nginx             nginx              93 Jun 15 13:50 cmclogs
drwx--x--x  2 root              root                6 Jun 28 11:30 conf
drwxr-xr-x  3 root              root               20 Apr 10  2019 console
drwxrwxrwx 12 root              root              139 Apr 10  2019 content
drwxr-xr-x  4 root              root               47 Aug 13  2019 editor
drwxr-xr-x  3 root              root              123 May 13  2019 elastic
drwxrwxrwx  3 root              root               26 Feb 28 15:53 esdata
drwxrwxrwx  3 root              root               26 Feb 28 16:02 esdatadev
drwxrwxrwx  3 root              root               26 Jul 22 16:02 esdatadev2
drwxr-xr-x  2 root              root               19 Jul  8  2019 ffmpeg
-rw-------  1 root              root       3167531079 May  7  2019 gc.hprof
-rw-r--r--  1 root              root        387737048 May  7  2019 gc.tar.gz
-rw-r--r--  1 root              root              664 Apr 10  2019 header.txt
-rw-r--r--  1 root              root             1195 Jun 19  2019 hua-qiyun-6803fac4-b7c0-4fea-a44b-332e171e95d5-v5.json
drwxr-xr-x  2 root              root             4096 Aug  3 00:00 log-cms
drwxr-xr-x  2 nginx             nginx            4096 Aug  3 14:23 log-static
drwx--x--x  6 root              root            16384 Aug  3 16:57 logs
drwxrwxrwx  2 root              root                6 Jun  8 13:34 media
drwxr-xr-x  4 root              root               48 Jul 29  2019 models
drwxrwxrwx  3 root              root               17 Dec 11  2018 ms3
drwxr-xr-x 47 systemd-bus-proxy input            4096 Mar 25 23:40 mysql
drwxrwxrwx  4 root              root               35 Dec 11  2018 nas-tmp
-rw-r--r--  1 root              root            40956 Oct 29  2019 output.mp3
drwxr-xr-x  6 root              root               67 Mar  6 10:50 pgc
drwxr-xr-x  3 root              root               25 Dec 13  2019 pic
-rw-r--r--  1 root              root                9 Apr 10  2019 requestBodyParams.txt
-rw-r--r--  1 root              root              573 Apr 10  2019 requestRowBody.txt
drwx--x--x  2 root              root                6 Jun 28 11:30 run
drwxr-xr-x  8 root              root             4096 Mar 16 16:42 shift
drwxr-xr-x 14 root              root             4096 Mar 17 04:00 shiftdev
drwxr-xr-x  8 root              root              106 May 15 21:09 site
-rw-r--r--  1 root              root             3178 Jun 14  2019 spiderLogo.png
drwxrwxrwx  6 systemd-bus-proxy input             155 Jun 19 15:34 sqldev
drwxrwxrwx  4 root              root               41 Jun  8 13:37 trans
drwxr-xr-x  8 nginx             nginx            4096 Jun 28 13:28 version_sql
drwxr-xr-x  3 root              root               25 Dec 13  2019 video
drwxr-xr-x  2 root              root                6 Nov 27  2019 vidoe
drwxrwxrwx 36 root              root             4096 Jul 31 11:33 wangjie
drwxrwxrwx 18 root              root             4096 Jul 31 18:32 wangjiebase
drwxrwxrwx 17 root              root             4096 Jul  3 17:14 wangjiedev
drwxrwxr-x 10 root              root              102 Apr 11  2019 wangjieweb
drwxrwxrwx  4 root              root               33 Mar 29  2019 wangjiewjweb
drwxr-xr-x  3 root              root               20 May 20  2019 webtv
drwxr-xr-x  3 root              root               20 Jan 31  2019 wjdev
drwxr-xr-x  4 root              root               34 Mar 18  2019 wpdt
drwxrwxrwx  6 root              root               54 Apr  9  2019 xContent
drwxrwxrwx  5 root              root               58 Jul  3 16:49 xcontent
drwxrwxrwx  3 root              root               17 Apr 10  2019 xtrimmer
drwxrwxrwx  7 root              root              140 Jul 21 15:19 zqtest

6. Analyze the difference before and after adding the scheduling rule. Before adding it, the host was: lb. After adding it, the host is: wjdev02. As shown in Figure 6 and Figure 7.

Before adding it, the host was: lb.
Figure 6
After adding it, the host is: wjdev02.
Figure 7

7. Check the storage of hosts lb and wjdev02 respectively. /webtv does not exist on lb, but exists on wjdev02. As shown in Figure 8 and Figure 9.

Check the storage of hosts lb and wjdev02 respectively; /webtv does not exist on lb.
Figure 8
Check the storage of hosts lb and wjdev02 respectively; /webtv exists on wjdev02.
Figure 9

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系