Kubernetes(k8s)之分布式文件系统glusterfs

1、为什么使用分布式文件系统glusterfs

答:使用持久化存储nfs,但是使用nfs这个共享存储特别简单,但是后期在扩容和管理方面都特别的不方便,在生产中一般都是使用分布式文件系统,这里使用的是分布式文件系统glusterfs。

2、什么是分布式文件系统glusterfs

答:分布式文件系统glusterfs是一个开源分布式文件系统,具有强大的横向扩展能力,可以支持数PB存储容器和数千客户端,通过网络互联成一个并行的网络文件系统。具有可扩展性、高性能、高可用性等特点。

3、安装分布式文件系统glusterfs,需要所有节点都需要进行安装的,如下所示:

首先在三台节点上都安装glusterfs的yum源,如下所示:

 1 [root@k8s-master ~]# yum install centos-release-gluster -y
 2 Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
 3 
 4 This system is not registered with an entitlement server. You can use subscription-manager to register.
 5 
 6 Loading mirror speeds from cached hostfile
 7  * base: mirrors.bfsu.edu.cn
 8  * extras: mirrors.bfsu.edu.cn
 9  * updates: mirrors.bfsu.edu.cn
10 base                                                                                                     | 3.6 kB  00:00:00     
11 extras                                                                                                   | 2.9 kB  00:00:00     
12 updates                                                                                                  | 2.9 kB  00:00:00     
13 Resolving Dependencies
14 --> Running transaction check
15 ---> Package centos-release-gluster7.noarch 0:1.0-2.el7.centos will be installed
16 --> Processing Dependency: centos-release-storage-common for package: centos-release-gluster7-1.0-2.el7.centos.noarch
17 --> Running transaction check
18 ---> Package centos-release-storage-common.noarch 0:2-2.el7.centos will be installed
19 --> Finished Dependency Resolution
20 
21 Dependencies Resolved
22 
23 =================================================================================================================================================================================================================
24  Package                                                          Arch                                      Version                                              Repository                                 Size
25 =================================================================================================================================================================================================================
26 Installing:
27  centos-release-gluster7                                          noarch                                    1.0-2.el7.centos                                     extras                                    5.2 k
28 Installing for dependencies:
29  centos-release-storage-common                                    noarch                                    2-2.el7.centos                                       extras                                    5.1 k
30 
31 Transaction Summary
32 =================================================================================================================================================================================================================
33 Install  1 Package (+1 Dependent package)
34 
35 Total download size: 10 k
36 Installed size: 2.4 k
37 Downloading packages:
38 (1/2): centos-release-gluster7-1.0-2.el7.centos.noarch.rpm                                                                                                                                | 5.2 kB  00:00:00     
39 (2/2): centos-release-storage-common-2-2.el7.centos.noarch.rpm                                                                                                                            | 5.1 kB  00:00:00     
40 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
41 Total                                                                                                                                                                             13 kB/s |  10 kB  00:00:00     
42 Running transaction check
43 Running transaction test
44 Transaction test succeeded
45 Running transaction
46   Installing : centos-release-storage-common-2-2.el7.centos.noarch                                                                                                                                           1/2 
47   Installing : centos-release-gluster7-1.0-2.el7.centos.noarch                                                                                                                                               2/2 
48   Verifying  : centos-release-gluster7-1.0-2.el7.centos.noarch                                                                                                                                               1/2 
49   Verifying  : centos-release-storage-common-2-2.el7.centos.noarch                                                                                                                                           2/2 
50 
51 Installed:
52   centos-release-gluster7.noarch 0:1.0-2.el7.centos                                                                                                                                                              
53 
54 Dependency Installed:
55   centos-release-storage-common.noarch 0:2-2.el7.centos                                                                                                                                                          
56 
57 Complete!
58 [root@k8s-master ~]# 

可以看到yum源里面多了一些文件,默认安装的是CentOS-Gluster-7.repo这个7.x版本的,如下所示:

1 [root@k8s-master ~]# ls /etc/yum.repos.d/
2 CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Gluster-7.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Storage-common.repo  CentOS-Vault.repo
3 [root@k8s-master ~]# 

然后开始在三台节点上安装glusterfs-server包安装上,最主要的就是安装这个包的,如下所示:

  1 [root@k8s-master ~]# yum install install glusterfs-server -y
  2 Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
  3 
  4 This system is not registered with an entitlement server. You can use subscription-manager to register.
  5 
  6 Loading mirror speeds from cached hostfile
  7  * base: mirrors.bfsu.edu.cn
  8  * centos-gluster7: mirrors.tuna.tsinghua.edu.cn
  9  * extras: mirrors.bfsu.edu.cn
 10  * updates: mirrors.bfsu.edu.cn
 11 centos-gluster7                                                                                                                                                                           | 3.0 kB  00:00:00     
 12 centos-gluster7/7/x86_64/primary_db                                                                                                                                                       |  69 kB  00:00:00     
 13 No package install available.
 14 Resolving Dependencies
 15 --> Running transaction check
 16 ---> Package glusterfs-server.x86_64 0:7.6-1.el7 will be installed
 17 --> Processing Dependency: glusterfs = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 18 --> Processing Dependency: glusterfs-api = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 19 --> Processing Dependency: glusterfs-cli = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 20 --> Processing Dependency: glusterfs-client-xlators = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 21 --> Processing Dependency: glusterfs-fuse = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 22 --> Processing Dependency: glusterfs-libs = 7.6-1.el7 for package: glusterfs-server-7.6-1.el7.x86_64
 23 --> Processing Dependency: libgfapi.so.0(GFAPI_6.0)(64bit) for package: glusterfs-server-7.6-1.el7.x86_64
 24 --> Processing Dependency: libgfapi.so.0(GFAPI_PRIVATE_6.0)(64bit) for package: glusterfs-server-7.6-1.el7.x86_64
 25 --> Processing Dependency: libgfapi.so.0(GFAPI_PRIVATE_6.1)(64bit) for package: glusterfs-server-7.6-1.el7.x86_64
 26 --> Processing Dependency: liburcu-bp.so.6()(64bit) for package: glusterfs-server-7.6-1.el7.x86_64
 27 --> Processing Dependency: liburcu-cds.so.6()(64bit) for package: glusterfs-server-7.6-1.el7.x86_64
 28 --> Running transaction check
 29 ---> Package glusterfs.x86_64 0:3.12.2-18.el7 will be updated
 30 ---> Package glusterfs.x86_64 0:7.6-1.el7 will be an update
 31 ---> Package glusterfs-api.x86_64 0:3.12.2-18.el7 will be updated
 32 ---> Package glusterfs-api.x86_64 0:7.6-1.el7 will be an update
 33 ---> Package glusterfs-cli.x86_64 0:3.12.2-18.el7 will be updated
 34 ---> Package glusterfs-cli.x86_64 0:7.6-1.el7 will be an update
 35 ---> Package glusterfs-client-xlators.x86_64 0:3.12.2-18.el7 will be updated
 36 ---> Package glusterfs-client-xlators.x86_64 0:7.6-1.el7 will be an update
 37 ---> Package glusterfs-fuse.x86_64 0:7.6-1.el7 will be installed
 38 ---> Package glusterfs-libs.x86_64 0:3.12.2-18.el7 will be updated
 39 ---> Package glusterfs-libs.x86_64 0:7.6-1.el7 will be an update
 40 ---> Package userspace-rcu.x86_64 0:0.10.0-3.el7 will be installed
 41 --> Finished Dependency Resolution
 42 
 43 Dependencies Resolved
 44 
 45 =================================================================================================================================================================================================================
 46  Package                                                     Arch                                      Version                                          Repository                                          Size
 47 =================================================================================================================================================================================================================
 48 Installing:
 49  glusterfs-server                                            x86_64                                    7.6-1.el7                                        centos-gluster7                                    1.3 M
 50 Installing for dependencies:
 51  glusterfs-fuse                                              x86_64                                    7.6-1.el7                                        centos-gluster7                                    156 k
 52  userspace-rcu                                               x86_64                                    0.10.0-3.el7                                     centos-gluster7                                     93 k
 53 Updating for dependencies:
 54  glusterfs                                                   x86_64                                    7.6-1.el7                                        centos-gluster7                                    640 k
 55  glusterfs-api                                               x86_64                                    7.6-1.el7                                        centos-gluster7                                    114 k
 56  glusterfs-cli                                               x86_64                                    7.6-1.el7                                        centos-gluster7                                    198 k
 57  glusterfs-client-xlators                                    x86_64                                    7.6-1.el7                                        centos-gluster7                                    850 k
 58  glusterfs-libs                                              x86_64                                    7.6-1.el7                                        centos-gluster7                                    425 k
 59 
 60 Transaction Summary
 61 =================================================================================================================================================================================================================
 62 Install  1 Package  (+2 Dependent packages)
 63 Upgrade             ( 5 Dependent packages)
 64 
 65 Total download size: 3.7 M
 66 Downloading packages:
 67 No Presto metadata available for centos-gluster7
 68 warning: /var/cache/yum/x86_64/7/centos-gluster7/packages/glusterfs-cli-7.6-1.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID e451e5b5: NOKEY                             ]  0.0 B/s |    0 B  --:--:-- ETA 
 69 Public key for glusterfs-cli-7.6-1.el7.x86_64.rpm is not installed
 70 (1/8): glusterfs-cli-7.6-1.el7.x86_64.rpm                                                                                                                                                 | 198 kB  00:00:00     
 71 (2/8): glusterfs-api-7.6-1.el7.x86_64.rpm                                                                                                                                                 | 114 kB  00:00:00     
 72 (3/8): glusterfs-libs-7.6-1.el7.x86_64.rpm                                                                                                                                                | 425 kB  00:00:00     
 73 (4/8): glusterfs-fuse-7.6-1.el7.x86_64.rpm                                                                                                                                                | 156 kB  00:00:01     
 74 (5/8): glusterfs-client-xlators-7.6-1.el7.x86_64.rpm                                                                                                                                      | 850 kB  00:00:03     
 75 (6/8): glusterfs-7.6-1.el7.x86_64.rpm                                                                                                                                                     | 640 kB  00:00:03     
 76 (7/8): glusterfs-server-7.6-1.el7.x86_64.rpm                                                                                                                                              | 1.3 MB  00:00:04     
 77 (8/8): userspace-rcu-0.10.0-3.el7.x86_64.rpm                                                                                                                                              |  93 kB  00:00:13     
 78 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 79 Total                                                                                                                                                                            242 kB/s | 3.7 MB  00:00:15     
 80 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
 81 Importing GPG key 0xE451E5B5:
 82  Userid     : "CentOS Storage SIG (http://wiki.centos.org/SpecialInterestGroup/Storage) "
 83  Fingerprint: 7412 9c0b 173b 071a 3775 951a d4a2 e50b e451 e5b5
 84  Package    : centos-release-storage-common-2-2.el7.centos.noarch (@extras)
 85  From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
 86 Running transaction check
 87 Running transaction test
 88 Transaction test succeeded
 89 Running transaction
 90   Updating   : glusterfs-libs-7.6-1.el7.x86_64                                                                                                                                                              1/13 
 91   Updating   : glusterfs-client-xlators-7.6-1.el7.x86_64                                                                                                                                                    2/13 
 92   Updating   : glusterfs-7.6-1.el7.x86_64                                                                                                                                                                   3/13 
 93   Updating   : glusterfs-api-7.6-1.el7.x86_64                                                                                                                                                               4/13 
 94   Installing : glusterfs-fuse-7.6-1.el7.x86_64                                                                                                                                                              5/13 
 95   Updating   : glusterfs-cli-7.6-1.el7.x86_64                                                                                                                                                               6/13 
 96   Installing : userspace-rcu-0.10.0-3.el7.x86_64                                                                                                                                                            7/13 
 97   Installing : glusterfs-server-7.6-1.el7.x86_64                                                                                                                                                            8/13 
 98   Cleanup    : glusterfs-api-3.12.2-18.el7.x86_64                                                                                                                                                           9/13 
 99   Cleanup    : glusterfs-3.12.2-18.el7.x86_64                                                                                                                                                              10/13 
100   Cleanup    : glusterfs-client-xlators-3.12.2-18.el7.x86_64                                                                                                                                               11/13 
101   Cleanup    : glusterfs-cli-3.12.2-18.el7.x86_64                                                                                                                                                          12/13 
102   Cleanup    : glusterfs-libs-3.12.2-18.el7.x86_64                                                                                                                                                         13/13 
103   Verifying  : glusterfs-libs-7.6-1.el7.x86_64                                                                                                                                                              1/13 
104   Verifying  : glusterfs-api-7.6-1.el7.x86_64                                                                                                                                                               2/13 
105   Verifying  : glusterfs-cli-7.6-1.el7.x86_64                                                                                                                                                               3/13 
106   Verifying  : glusterfs-fuse-7.6-1.el7.x86_64                                                                                                                                                              4/13 
107   Verifying  : glusterfs-client-xlators-7.6-1.el7.x86_64                                                                                                                                                    5/13 
108   Verifying  : glusterfs-server-7.6-1.el7.x86_64                                                                                                                                                            6/13 
109   Verifying  : glusterfs-7.6-1.el7.x86_64                                                                                                                                                                   7/13 
110   Verifying  : userspace-rcu-0.10.0-3.el7.x86_64                                                                                                                                                            8/13 
111   Verifying  : glusterfs-3.12.2-18.el7.x86_64                                                                                                                                                               9/13 
112   Verifying  : glusterfs-cli-3.12.2-18.el7.x86_64                                                                                                                                                          10/13 
113   Verifying  : glusterfs-client-xlators-3.12.2-18.el7.x86_64                                                                                                                                               11/13 
114   Verifying  : glusterfs-libs-3.12.2-18.el7.x86_64                                                                                                                                                         12/13 
115   Verifying  : glusterfs-api-3.12.2-18.el7.x86_64                                                                                                                                                          13/13 
116 
117 Installed:
118   glusterfs-server.x86_64 0:7.6-1.el7                                                                                                                                                                            
119 
120 Dependency Installed:
121   glusterfs-fuse.x86_64 0:7.6-1.el7                                                                      userspace-rcu.x86_64 0:0.10.0-3.el7                                                                     
122 
123 Dependency Updated:
124   glusterfs.x86_64 0:7.6-1.el7        glusterfs-api.x86_64 0:7.6-1.el7        glusterfs-cli.x86_64 0:7.6-1.el7        glusterfs-client-xlators.x86_64 0:7.6-1.el7        glusterfs-libs.x86_64 0:7.6-1.el7       
125 
126 Complete!
127 [root@k8s-master ~]# 

然后开始启动glusterfs,并设置开机自启动,如下所示:

1 [root@k8s-master ~]# systemctl start glusterd.service
2 [root@k8s-master ~]# systemctl enable glusterd.service
3 [root@k8s-master ~]# 

生产环境可以增加一个/dev/sdb或者/dev/sdc用于挂载,将它挂载到某一个目录下面去使用的,默认只有/dev/sda。这里直接增加目录来使用了,在三台机器上都执行下面的创建目录的命令,如下所示:

1 [root@k8s-master ~]# mkdir -p /gfs/test1
2 [root@k8s-master ~]# mkdir -p /gfs/test2
3 [root@k8s-master ~]# 

添加存储资源池,即将节点都组装起来,在master主节点进行操作,可以查看gluster的资源池(如果gluster没有提示,可以先退出xshell,再重新登录即可),如下所示:

 1 [root@k8s-master ~]# gluster pool list
 2 UUID                    Hostname     State
 3 d2ea56bf-6402-49c5-93a2-0d784110b231    localhost    Connected 
 4 [root@k8s-master ~]# gluster pool 
 5 unrecognized command
 6 
 7  Usage: gluster [options]    
 8  Options:
 9  --help  Shows the help information
10  --version  Shows the version
11  --print-logdir  Shows the log directory
12  --print-statedumpdir Shows the state dump directory
13 
14 [root@k8s-master ~]# 

资源池默认只能识别出自己本身,这里需要将另外两个节点加入到资源池中,根据hostname加入到资源池,需要做host解析的,如下所示:

1 [root@k8s-master ~]# gluster peer 
2 detach  probe   status  
3 [root@k8s-master ~]# gluster peer probe k8s-node2
4 peer probe: success. 
5 [root@k8s-master ~]# gluster peer probe k8s-node3
6 peer probe: success. 
7 [root@k8s-master ~]# 

此时,再次查看资源池,发现已经有了三个节点了,如下所示:

1 [root@k8s-master ~]# gluster pool list 
2 UUID                    Hostname     State
3 977fb392-500c-4353-b03c-0ee9e53cee29    k8s-node2    Connected 
4 3b7c328f-2eff-4098-b3ac-ebc730975d22    k8s-node3    Connected 
5 d2ea56bf-6402-49c5-93a2-0d784110b231    localhost    Connected 
6 [root@k8s-master ~]# 

资源池添加完毕之后,开始进行glusterfs卷管理,创建分布式复制卷,如下所示:

可以在资源池里面使用资源池创建一个卷,在生产环境中glusterfs支持七种模式的卷,使用最多的是分布式复制卷,其他有的卷不稳定肯能会丢失书数据,最稳定的一种就是分布式复制卷,分布式复制卷要求至少四个存储单元,就是刚才创建的目录,正常情况下,一个目录就要挂载一个空的硬盘,一个硬盘就是一个存储单元,或者说一个目录就是一个存储单元,glusterfs这个分布式复制卷,最少复制的副本是2,再加上是分布式,至少要有四个目录作为存储单元。

1 [root@k8s-master ~]# gluster volume create biehl replica 2 k8s-master:/gfs/test1 k8s-master:/gfs/test2 k8s-node2:/gfs/test1 k8s-node2:/gfs/test2 force
2 volume create: biehl: success: please start the volume to access data
3 [root@k8s-master ~]# 

卷已经创建成功了,现在需要启动一下才可以访问里面的数据,启动卷并进行查看卷,如下所示:

 1 [root@k8s-master ~]# gluster volume start biehl 
 2 volume start: biehl: success
 3 [root@k8s-master ~]# gluster volume info biehl 
 4  
 5 Volume Name: biehl
 6 Type: Distributed-Replicate
 7 Volume ID: 5729192c-627f-4444-92eb-32a245086f43
 8 Status: Started
 9 Snapshot Count: 0
10 Number of Bricks: 2 x 2 = 4
11 Transport-type: tcp
12 Bricks:
13 Brick1: k8s-master:/gfs/test1
14 Brick2: k8s-master:/gfs/test2
15 Brick3: k8s-node2:/gfs/test1
16 Brick4: k8s-node2:/gfs/test2
17 Options Reconfigured:
18 transport.address-family: inet
19 storage.fips-mode-rchecksum: on
20 nfs.disable: on
21 performance.client-io-threads: off
22 [root@k8s-master ~]# 

下面开始挂载卷,可以在三台机器的任意一个节点上进行挂载,如下所示:

1 [root@k8s-master ~]# mount -t glusterfs 192.168.110.133:/biehl /mnt
2 [root@k8s-master ~]# 

含义就是将192.168.110.133的biehl卷,挂载到mnt目录下面,现在可以进行查看,如下所示:

 1 [root@k8s-master ~]# df -h
 2 Filesystem               Size  Used Avail Use% Mounted on
 3 /dev/mapper/centos-root   18G   14G  3.9G  79% /
 4 devtmpfs                 1.2G     0  1.2G   0% /dev
 5 tmpfs                    1.2G     0  1.2G   0% /dev/shm
 6 tmpfs                    1.2G   40M  1.1G   4% /run
 7 tmpfs                    1.2G     0  1.2G   0% /sys/fs/cgroup
 8 /dev/sda1                197M  157M   41M  80% /boot
 9 tmpfs                    229M   12K  229M   1% /run/user/42
10 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/fbf4133aed53d4e17a706be46fadcbea9fe6eb1e615379bfaa157570f0de7bc6/merged
11 shm                       64M     0   64M   0% /var/lib/docker/containers/5e72b0961647003c757fd41ffe824027c857d1f3938b9a53535645f4f372a40a/shm
12 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/80967f34f76b4afe42411f1b1dc6514b2b19d997644dfa4687a3a0924df06a08/merged
13 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/e085a4fba182d19139db32c664fcc1f08895ca603db3b1f9855183fc071c1adc/merged
14 shm                       64M     0   64M   0% /var/lib/docker/containers/276a98c9d5ccd61f42a0a1ef55c30f76beb2977483ed2d79281dfcec79922029/shm
15 shm                       64M     0   64M   0% /var/lib/docker/containers/0f89914f64c09c0fbd777e637d8f987414420861628d7b78f8a1bafc9054df59/shm
16 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/23afbc15307f6e5b397db4b1fd0e124c943bdb95312234e8d41e4f80a104b0cd/merged
17 shm                       64M     0   64M   0% /var/lib/docker/containers/f686976b5743236b368b8b70e222d230b737612acadc716ca4cbabcd9a187011/shm
18 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/15696b3573a066b5d3fd7aa202086b2bcc4145d9d0bb46e54c7d8d7787d1cc73/merged
19 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/6d9b6978705654a815dd1e72d5501408cead42493c25bdd33e4faa0c9decdcd0/merged
20 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/534837088c8ba6021c80d2ebb4ddb87a075106a784c499cc9ffca541d2e86dce/merged
21 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/8cdf1249e1823f24caf1d14ca9c05caa4e8e569d81292d06c642e618bc90b82b/merged
22 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/3ee0d48c04a32a2f0938af17898697042423d7d147df3ee8c1178bfda6e5fd9a/merged
23 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/31f5db66511cc7fd15cf1e2a23b7178d0eafbf1d7ddbdef1e0f82a254b6f6fc5/merged
24 overlay                   18G   14G  3.9G  79% /var/lib/docker/overlay2/16288e087e06b2c1fc369d19528eeb933cde44b8aa785f35b6756ec4da3a0f60/merged
25 tmpfs                    229M     0  229M   0% /run/user/0
26 192.168.110.133:/biehl    18G   11G  7.1G  61% /mnt
27 [root@k8s-master ~]# df -h /mnt/
28 Filesystem              Size  Used Avail Use% Mounted on
29 192.168.110.133:/biehl   18G   11G  7.1G  61% /mnt
30 [root@k8s-master ~]# 

分布式复制卷扩容,可以先使用df -h命令进行查看扩容前的容量,然后扩容后查看容量,在运行状态也可以进行扩容的哦,如下所示:

1 [root@k8s-master ~]# df -h /mnt/
2 Filesystem              Size  Used Avail Use% Mounted on
3 192.168.110.133:/biehl   18G   11G  7.1G  61% /mnt
4 [root@k8s-master ~]# gluster volume add-brick biehl k8s-node3:/gfs/test1 k8s-node3:/gfs/test2 force
5 volume add-brick: success
6 [root@k8s-master ~]# df -h /mnt/
7 Filesystem              Size  Used Avail Use% Mounted on
8 192.168.110.133:/biehl   23G   15G  8.8G  62% /mnt
9 [root@k8s-master ~]# 

接下来,可以向/mnt目录里面上传一些文件进行观察,如下所示:

1 [root@k8s-master ~]# cd /mnt/
2 [root@k8s-master mnt]# rz -E
3 rz waiting to receive.
4 [root@k8s-master mnt]# ls
5 book-master6.0.war
6 [root@k8s-master mnt]# unzip book-master6.0.war 

解压之后显示一堆文件,这些文件会分别在放到不同的存储单元中,首先查看master主节点的目录单元,如下所示:

 1 [root@k8s-master mnt]# yum install tree
 2 Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
 3 
 4 This system is not registered with an entitlement server. You can use subscription-manager to register.
 5 
 6 Loading mirror speeds from cached hostfile
 7  * base: mirrors.bfsu.edu.cn
 8  * centos-gluster7: mirrors.tuna.tsinghua.edu.cn
 9  * extras: mirrors.bfsu.edu.cn
10  * updates: mirrors.bfsu.edu.cn
11 Resolving Dependencies
12 --> Running transaction check
13 ---> Package tree.x86_64 0:1.6.0-10.el7 will be installed
14 --> Finished Dependency Resolution
15 
16 Dependencies Resolved
17 
18 =================================================================================================================================================================================================================
19  Package                                         Arch                                              Version                                                 Repository                                       Size
20 =================================================================================================================================================================================================================
21 Installing:
22  tree                                            x86_64                                            1.6.0-10.el7                                            base                                             46 k
23 
24 Transaction Summary
25 =================================================================================================================================================================================================================
26 Install  1 Package
27 
28 Total download size: 46 k
29 Installed size: 87 k
30 Is this ok [y/d/N]: y
31 Downloading packages:
32 tree-1.6.0-10.el7.x86_64.rpm                                                                                                                                                              |  46 kB  00:00:05     
33 Running transaction check
34 Running transaction test
35 Transaction test succeeded
36 Running transaction
37   Installing : tree-1.6.0-10.el7.x86_64                                                                                                                                                                      1/1 
38   Verifying  : tree-1.6.0-10.el7.x86_64                                                                                                                                                                      1/1 
39 
40 Installed:
41   tree.x86_64 0:1.6.0-10.el7                                                                                                                                                                                     
42 
43 Complete!
44 [root@k8s-master mnt]# tree /gfs/

由于我的文件太多,就不进行展示了,使用命令tree /gfs就可以进行查看了,可以在三台机器都进行查看观察的。

 

4、glusterfs作为k8s的后端存储,可以使用命令查看k8s支持的后端存储类型,如下所示:

  1 [root@k8s-master test1]# kubectl explain pv.spec
  2 RESOURCE: spec 
  3 
  4 DESCRIPTION:
  5      Spec defines a specification of a persistent volume owned by the cluster.
  6      Provisioned by an administrator. More info:
  7      http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes
  8 
  9     PersistentVolumeSpec is the specification of a persistent volume.
 10 
 11 FIELDS:
 12    awsElasticBlockStore    
 13      AWSElasticBlockStore represents an AWS Disk resource that is attached to a
 14      kubelet's host machine and then exposed to the pod. More info:
 15      http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore
 16 
 17    cephfs    
 18      CephFS represents a Ceph FS mount on the host that shares a pod's lifetime
 19 
 20    fc    
 21      FC represents a Fibre Channel resource that is attached to a kubelet's host
 22      machine and then exposed to the pod.
 23 
 24    rbd    
 25      RBD represents a Rados Block Device mount on the host that shares a pod's
 26      lifetime. More info:
 27      http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md
 28 
 29    accessModes    <[]Object>
 30      AccessModes contains all ways the volume can be mounted. More info:
 31      http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes
 32 
 33    azureFile    
 34      AzureFile represents an Azure File Service mount on the host and bind mount
 35      to the pod.
 36 
 37    capacity    <object>
 38      A description of the persistent volume's resources and capacity. More info:
 39      http://kubernetes.io/docs/user-guide/persistent-volumes#capacity
 40 
 41    cinder    
 42      Cinder represents a cinder volume attached and mounted on kubelets host
 43      machine More info:
 44      http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md
 45 
 46    flocker    
 47      Flocker represents a Flocker volume attached to a kubelet's host machine
 48      and exposed to the pod for its usage. This depends on the Flocker control
 49      service being running
 50 
 51    nfs    
 52      NFS represents an NFS mount on the host. Provisioned by an admin. More
 53      info: http://kubernetes.io/docs/user-guide/volumes#nfs
 54 
 55    azureDisk    
 56      AzureDisk represents an Azure Data Disk mount on the host and bind mount to
 57      the pod.
 58 
 59    claimRef    
 60      ClaimRef is part of a bi-directional binding between PersistentVolume and
 61      PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName
 62      is the authoritative bind between PV and PVC. More info:
 63      http://kubernetes.io/docs/user-guide/persistent-volumes#binding
 64 
 65    gcePersistentDisk    
 66      GCEPersistentDisk represents a GCE Disk resource that is attached to a
 67      kubelet's host machine and then exposed to the pod. Provisioned by an admin.
 68      More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk
 69 
 70    persistentVolumeReclaimPolicy    <string>
 71      What happens to a persistent volume when released from its claim. Valid
 72      options are Retain (default) and Recycle. Recycling must be supported by the
 73      volume plugin underlying this persistent volume. More info:
 74      http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy
 75 
 76    photonPersistentDisk    
 77      PhotonPersistentDisk represents a PhotonController persistent disk attached
 78      and mounted on kubelets host machine
 79 
 80    vsphereVolume    
 81      VsphereVolume represents a vSphere volume attached and mounted on kubelets
 82      host machine
 83 
 84    flexVolume    
 85      FlexVolume represents a generic volume resource that is
 86      provisioned/attached using an exec based plugin. This is an alpha feature
 87      and may change in future.
 88 
 89    glusterfs    
 90      Glusterfs represents a Glusterfs volume that is attached to a host and
 91      exposed to the pod. Provisioned by an admin. More info:
 92      http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md
 93 
 94    hostPath    
 95      HostPath represents a directory on the host. Provisioned by a developer or
 96      tester. This is useful for single-node development and testing only! On-host
 97      storage is not supported in any way and WILL NOT WORK in a multi-node
 98      cluster. More info: http://kubernetes.io/docs/user-guide/volumes#hostpath
 99 
100    iscsi    
101      ISCSI represents an ISCSI Disk resource that is attached to a kubelet's
102      host machine and then exposed to the pod. Provisioned by an admin.
103 
104    quobyte    
105      Quobyte represents a Quobyte mount on the host that shares a pod's lifetime
106 
107 
108 [root@k8s-master test1]#  
    
   

可以查看详细的glusterfs配置需要什么,endpoints就是svc里面的一个资源,endpoints就是(clusterIP + 端口号),path就是glusterfs卷的一个路径,readOnly只读模式,如下所示:

 1 [root@k8s-master test1]# kubectl explain pv.spec.glusterfs
 2 RESOURCE: glusterfs 
 3 
 4 DESCRIPTION:
 5      Glusterfs represents a Glusterfs volume that is attached to a host and
 6      exposed to the pod. Provisioned by an admin. More info:
 7      http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md
 8 
 9     Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.
10 
11 FIELDS:
12    endpoints    <string> -required-
13      EndpointsName is the endpoint name that details Glusterfs topology. More
14      info:
15      http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod
16 
17    path    <string> -required-
18      Path is the Glusterfs volume path. More info:
19      http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod
20 
21    readOnly    
22      ReadOnly here will force the Glusterfs volume to be mounted with read-only
23      permissions. Defaults to false. More info:
24      http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod
25 
26 
27 [root@k8s-master test1]#  
    
   

开始创建endpoints的glusterfs-ep.yaml配置文件,如下所示:

1 [root@k8s-master k8s]# ls
2 book-master.war  dashboard  dashboard.zip  deploy  health  heapster  hpa  metrics  namespace  pod  rc  skydns  skydns.zip  svc  tomcat_demo  tomcat_demo.zip  volume
3 [root@k8s-master k8s]# mkdir glusterfs
4 [root@k8s-master k8s]# cd glusterfs/
5 [root@k8s-master glusterfs]# ls
6 [root@k8s-master glusterfs]# vim glusterfs-ep.yaml
7 [root@k8s-master glusterfs]# 

具体内容,如下所示:

 1 apiVersion: v1
 2 kind: Endpoints
 3 metadata:
 4   name: glusterfs
 5   namespace: default
 6 subsets:
 7 # k8s连接glusterfs的ip地址和端口号
 8 - addresses:
 9   - ip: 192.168.110.133
10   - ip: 192.168.110.134
11   - ip: 192.168.110.135
12   ports:
13   - port: 49152
14     protocol: TCP
15   

每个节点启动了glusterfs就存在了49152端口号,如下所示:

 1 [root@k8s-node3 test1]# netstat -lntup 49152
 2 Active Internet connections (only servers)
 3 Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
 4 tcp        0      0 0.0.0.0:24007           0.0.0.0:*               LISTEN      47623/glusterd      
 5 tcp        0      0 127.0.0.1:10248         0.0.0.0:*               LISTEN      14515/kubelet       
 6 tcp        0      0 127.0.0.1:10249         0.0.0.0:*               LISTEN      6779/kube-proxy     
 7 tcp        0      0 0.0.0.0:40842           0.0.0.0:*               LISTEN      -                   
 8 tcp        0      0 192.168.110.135:10250   0.0.0.0:*               LISTEN      14515/kubelet       
 9 tcp        0      0 192.168.110.135:10255   0.0.0.0:*               LISTEN      14515/kubelet       
10 tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
11 tcp        0      0 0.0.0.0:20048           0.0.0.0:*               LISTEN      90097/rpc.mountd    
12 tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      7122/X              
13 tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      7304/dnsmasq        
14 tcp        0      0 0.0.0.0:55318           0.0.0.0:*               LISTEN      52362/rpc.statd     
15 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6776/sshd           
16 tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      6778/cupsd          
17 tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7094/master         
18 tcp        0      0 0.0.0.0:49152           0.0.0.0:*               LISTEN      71495/glusterfsd    

开始创建这个endpoint,如下所示:

1 [root@k8s-master glusterfs]# kubectl create -f glusterfs-ep.yaml 
2 endpoints "glusterfs" created
3 [root@k8s-master glusterfs]# 

创建成功可以查看一下,如下所示:

 1 [root@k8s-master glusterfs]# kubectl get ep
 2 NAME         ENDPOINTS                                                           AGE
 3 glusterfs    192.168.110.133:49152,192.168.110.134:49152,192.168.110.135:49152   34s
 4 kubernetes   192.168.110.133:6443                                                25d
 5 mysql        172.16.66.6:3306                                                    5h
 6 myweb        172.16.66.5:8080                                                    6h
 7 [root@k8s-master glusterfs]# kubectl get endpoints 
 8 NAME         ENDPOINTS                                                           AGE
 9 glusterfs    192.168.110.133:49152,192.168.110.134:49152,192.168.110.135:49152   1m
10 kubernetes   192.168.110.133:6443                                                25d
11 mysql        172.16.66.6:3306                                                    5h
12 myweb        172.16.66.5:8080                                                    6h
13 [root@k8s-master glusterfs]# 

接下来,给这个endpoint创建一个Servic,需要注意的是Service和endpoint是靠名称来进行关联的,他们两个的名称必须一致的,如下所示:

1 [root@k8s-master glusterfs]# vim glusterfs-svc.yaml 
2 [root@k8s-master glusterfs]# 

配置内容,如下所示:

 1 apiVersion: v1
 2 kind: Service
 3 metadata:
 4   name: glusterfs
 5   namespace: default
 6 spec:
 7   ports:
 8   - port: 49152
 9     protocol: TCP
10     targetPort: 49152
11   sessionAffinity: None
12   type: ClusterIP
13   

开始进行创建Service,并进行查看,如下所示:

 1 [root@k8s-master glusterfs]# vim glusterfs-svc.yaml 
 2 [root@k8s-master glusterfs]# kubectl create -f glusterfs-svc.yaml 
 3 service "glusterfs" created
 4 [root@k8s-master glusterfs]# kubectl get svc 
 5 NAME         CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
 6 glusterfs    10.254.182.41            49152/TCP        10s
 7 kubernetes   10.254.0.1               443/TCP          25d
 8 mysql        10.254.126.11            3306/TCP         5h
 9 myweb        10.254.188.155          8080:30008/TCP   6h
10 [root@k8s-master glusterfs]# 

可以使用查看详情,看是否已经关联上了,如下所示:

 1 [root@k8s-master glusterfs]# kubectl describe svc glusterfs 
 2 Name:            glusterfs
 3 Namespace:        default
 4 Labels:            
 5 Selector:        
 6 Type:            ClusterIP
 7 IP:            10.254.182.41
 8 Port:                49152/TCP
 9 Endpoints:        192.168.110.133:49152,192.168.110.134:49152,192.168.110.135:49152
10 Session Affinity:    None
11 No events.
12 [root@k8s-master glusterfs]# 

接下来,开始创建glusterfs类型的PV,k8s对接各种后端存储的时候最关键的地方就是创建PV,如下所示:

1 [root@k8s-master glusterfs]# vim glusterfs-pv.yaml
2 [root@k8s-master glusterfs]# 

配置内容,如下所示:

 1 apiVersion: v1
 2 kind: PersistentVolume
 3 metadata:
 4   name: gluster
 5   labels:
 6     type: glusterfs
 7 spec:
 8   capacity:
 9     storage: 50Gi
10   accessModes:
11   - ReadWriteMany
12   glusterfs:
13     endpoints: "glusterfs"
14     path: "biehl"
15     readOnly: false

创建并查看PV,如下所示:

1 [root@k8s-master glusterfs]# gluster volume list 
2 biehl
3 [root@k8s-master glusterfs]# kubectl create -f glusterfs-pv.yaml 
4 persistentvolume "gluster" created
5 [root@k8s-master glusterfs]# kubectl get pv
6 NAME      CAPACITY   ACCESSMODES   RECLAIMPOLICY   STATUS      CLAIM           REASON    AGE
7 gluster   50Gi       RWX           Retain          Available                             9s
8 mysql     5Gi        RWX           Recycle         Bound       default/mysql             5h
9 [root@k8s-master glusterfs]# 

开始创建PVC,才可以使用PV,开始创建PVC,如下所示:

1 [root@k8s-master glusterfs]# cp ../tomcat_demo/mysql-pvc.yaml .
2 [root@k8s-master glusterfs]# ls
3 glusterfs-ep.yaml  glusterfs-pv.yaml  glusterfs-svc.yaml  mysql-pvc.yaml
4 [root@k8s-master glusterfs]# mv mysql-pvc.yaml glusterfs-pvc.yaml
5 [root@k8s-master glusterfs]# ls
6 glusterfs-ep.yaml  glusterfs-pvc.yaml  glusterfs-pv.yaml  glusterfs-svc.yaml
7 [root@k8s-master glusterfs]# 

配置内容,如下所示:

 1 kind: PersistentVolumeClaim
 2 apiVersion: v1
 3 metadata:
 4   name: gluster
 5 spec:
 6   accessModes:
 7     - ReadWriteMany
 8   resources:
 9     requests:
10       storage: 5Gi

创建并查看PVC、PV的内容,如下所示:

 1 [root@k8s-master glusterfs]# kubectl create -f glusterfs-pvc.yaml 
 2 persistentvolumeclaim "gluster" created
 3 [root@k8s-master glusterfs]# kubectl get pvc 
 4 NAME      STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
 5 gluster   Bound     gluster   50Gi       RWX           4s
 6 mysql     Bound     mysql     5Gi        RWX           6h
 7 [root@k8s-master glusterfs]# kubectl get pv
 8 NAME      CAPACITY   ACCESSMODES   RECLAIMPOLICY   STATUS    CLAIM             REASON    AGE
 9 gluster   50Gi       RWX           Retain          Bound     default/gluster             5m
10 mysql     5Gi        RWX           Recycle         Bound     default/mysql               6h
11 [root@k8s-master glusterfs]# 

PVC绑定PV之后就可以使用了,可以对pod进行使用,如下所示:

1 [root@k8s-master glusterfs]# ls
2 glusterfs-ep.yaml  glusterfs-pvc.yaml  glusterfs-pv.yaml  glusterfs-svc.yaml
3 [root@k8s-master glusterfs]# cp ../pod/nginx_pod.yaml .
4 [root@k8s-master glusterfs]# ls
5 glusterfs-ep.yaml  glusterfs-pvc.yaml  glusterfs-pv.yaml  glusterfs-svc.yaml  nginx_pod.yaml
6 [root@k8s-master glusterfs]# vim nginx_pod.yaml 
7 [root@k8s-master glusterfs]# 

将volumeMounts、volumes都配置好,如下所示:

 1 apiVersion: v1
 2 kind: Pod
 3 metadata:
 4   name: nginx
 5   labels:
 6     app: web
 7     env: nginx
 8 spec:
 9   containers:
10     - name: nginx
11       image: 192.168.110.133:5000/nginx:1.13
12       ports:
13         - containerPort: 80
14       volumeMounts:
15         - name: nfs-vol2
16           mountPath: /usr/share/nginx/html
17   volumes:
18     - name: nfs-vol2
19     persistentVolumeClaim:
20       claimName: gluster

创建nginx这个pod,并进行查看,发现已经正常运行起来了,如下所示:

1 [root@k8s-master glusterfs]# kubectl create -f nginx_pod.yaml 
2 pod "nginx" created
3 [root@k8s-master glusterfs]# kubectl get pods -o wide
4 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
5 mysql-wldks   1/1       Running   0          5h        172.16.66.6   k8s-node3
6 myweb-c8sf6   1/1       Running   1          7h        172.16.66.5   k8s-node3
7 nginx         1/1       Running   0          3s        172.16.66.3   k8s-node3
8 [root@k8s-master glusterfs]# 

然后可以访问一下这个Pod,如下所示:

1 [root@k8s-master glusterfs]# kubectl get pods -o wide
2 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
3 mysql-wldks   1/1       Running   0          5h        172.16.66.6   k8s-node3
4 myweb-c8sf6   1/1       Running   1          7h        172.16.66.5   k8s-node3
5 nginx         1/1       Running   0          3s        172.16.66.3   k8s-node3
6 [root@k8s-master glusterfs]# curl 172.16.66.3

我们的容器除了SVC里面通过反向代理和端口映射的方式访问之外,还可以让Pod不经过我们的SVC进行访问,可以在Pod里面,新增一个hostPort进行访问。
Kubernetes(k8s)之分布式文件系统glusterfs_第1张图片

将之前的nginx的pod删除掉,再重新创建一个,如下所示:

 1 [root@k8s-master glusterfs]# kubectl get pods -o wide
 2 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
 3 mysql-wldks   1/1       Running   0          7h        172.16.66.6   k8s-node3
 4 myweb-c8sf6   1/1       Running   1          9h        172.16.66.5   k8s-node3
 5 nginx         1/1       Running   0          2h        172.16.66.3   k8s-node3
 6 [root@k8s-master glusterfs]# kubectl delete pod nginx 
 7 pod "nginx" deleted
 8 [root@k8s-master glusterfs]# kubectl get pods -o wide
 9 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
10 mysql-wldks   1/1       Running   0          7h        172.16.66.6   k8s-node3
11 myweb-c8sf6   1/1       Running   1          9h        172.16.66.5   k8s-node3
12 [root@k8s-master glusterfs]# kubectl create -f nginx_pod.yaml 
13 pod "nginx" created
14 [root@k8s-master glusterfs]# kubectl get pods -o wide
15 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
16 mysql-wldks   1/1       Running   0          7h        172.16.66.6   k8s-node3
17 myweb-c8sf6   1/1       Running   1          9h        172.16.66.5   k8s-node3
18 nginx         1/1       Running   0          2s        172.16.66.3   k8s-node3
19 [root@k8s-master glusterfs]# 

可以看到新创建的nginx在k8s-node3这个节点上了,但是此时我发现无论curl访问还是浏览器访问都是403错误,这不都是很郁闷了。

1 [root@k8s-master glusterfs]# curl -I 172.16.66.3
2 HTTP/1.1 403 Forbidden
3 Server: nginx/1.15.12
4 Date: Tue, 30 Jun 2020 14:03:56 GMT
5 Content-Type: text/html
6 Content-Length: 154
7 Connection: keep-alive

后来经过仔细地分析和查找,发现是确实访问不到页面才出现地错误,究其原因,主要就是/mnt目录下面要有可以直接访问地界面才可以地。

1 [root@k8s-master glusterfs]# cd /mnt/
2 [root@k8s-master mnt]# ls
3 css  img  index.html  js

删除之前地nginx地pod,创建新的pod,如下所示:

 1 [root@k8s-master glusterfs]# kubectl get pod -o wide
 2 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
 3 mysql-wldks   1/1       Running   0          8h        172.16.66.6   k8s-node3
 4 myweb-c8sf6   1/1       Running   1          10h       172.16.66.5   k8s-node3
 5 nginx         1/1       Running   0          6m        172.16.66.3   k8s-node3
 6 nginx2        1/1       Running   0          17m       172.16.74.5   k8s-node2
 7 [root@k8s-master glusterfs]# kubectl delete pod nginx
 8 pod "nginx" deleted
 9 [root@k8s-master glusterfs]# kubectl get pod -o wide
10 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
11 mysql-wldks   1/1       Running   0          8h        172.16.66.6   k8s-node3
12 myweb-c8sf6   1/1       Running   1          10h       172.16.66.5   k8s-node3
13 nginx2        1/1       Running   0          17m       172.16.74.5   k8s-node2
14 [root@k8s-master glusterfs]# kubectl create -f nginx_pod.yaml 
15 pod "nginx" created
16 [root@k8s-master glusterfs]# kubectl get pod -o wide
17 NAME          READY     STATUS    RESTARTS   AGE       IP            NODE
18 mysql-wldks   1/1       Running   0          8h        172.16.66.6   k8s-node3
19 myweb-c8sf6   1/1       Running   1          10h       172.16.66.5   k8s-node3
20 nginx         1/1       Running   0          2s        172.16.66.3   k8s-node3
21 nginx2        1/1       Running   0          18m       172.16.74.5   k8s-node2
22 [root@k8s-master glusterfs]# curl 172.16.66.3
23 
24 "en">
25 
26 "UTF-8">
27 "viewport" content="width=device-width, initial-scale=1.0">
28 "X-UA-Compatible" content="ie=edge">
29 HTML5ȫı·ɻСԎϷ - Դë֮¼м/title>
<span>30</span> 
<span>31</span> <style>
<span>32</span> <span>    html {
</span><span>33</span>         width: <span>100</span>%<span>;
</span><span>34</span>         height: <span>100</span>%<span>;
</span><span>35</span>         margin: <span>0</span><span>;
</span><span>36</span>         padding: <span>0</span><span>;
</span><span>37</span> <span>        position: relative;
</span><span>38</span>         background-image: linear-<span>gradient(#2C3E50,#4CA1AF);
</span><span>39</span> 
<span>40</span> <span>    }
</span><span>41</span> 
<span>42</span> <span>    .canvasbig {
</span><span>43</span> <span>        position: absolute;
</span><span>44</span>         left: calc(<span>50</span>% -<span> 260px);
</span><span>45</span>         top: calc(<span>50</span>% -<span> 400px);
</span><span>46</span> <span>        width: 520px;
</span><span>47</span> <span>        height: 800px;
</span><span>48</span>         
<span>49</span> <span>    }
</span><span>50</span> 
<span>51</span> <span>    .canvasdiv {
</span><span>52</span> <span>        position: absolute;
</span><span>53</span> <span>        cursor: pointer;
</span><span>54</span> <span>        left: 160px;
</span><span>55</span> <span>        top: 500px;
</span><span>56</span> <span>        width: 200px;
</span><span>57</span> <span>        height: 53px;
</span><span>58</span>         background-image: url(img/<span>starting.png);
</span><span>59</span> <span>    }
</span><span>60</span> 
<span>61</span> <span>    .none {
</span><span>62</span> <span>        display: none;
</span><span>63</span> <span>    }
</span><span>64</span> </style>
<span>65</span> 
<span>66</span> </head>
<span>67</span> <body>
<span>68</span> 
<span>69</span> <!-- <script src=<span>"</span><span>js/circle.js</span><span>"</span>></script> -->
<span>70</span> 
<span>71</span> <div <span>class</span>=<span>"</span><span>canvasbig</span><span>"</span>>
<span>72</span>     <div <span>class</span>=<span>"</span><span>canvasdiv</span><span>"</span>></div>
<span>73</span>     <canvas width=<span>"</span><span>520</span><span>"</span> height=<span>"</span><span>800</span><span>"</span> id=<span>"</span><span>canvas1</span><span>"</span>></canvas>
<span>74</span> </div>
<span>75</span> 
<span>76</span> <script src=<span>"</span><span>js/index.js</span><span>"</span>></script>
<span>77</span> <div style=<span>"</span><span>text-align:center;</span><span>"</span>>
<span>78</span> <p>¸Ϗ·£º<a href=<span>"</span><span>http://www.mycodes.net/</span><span>"</span> target=<span>"</span><span>_blank</span><span>"</span>>Դë֮¼м/a></p>
<span>79</span> </div>
<span>80</span> </body>
<span>81</span> </html>[root@k8s-master glusterfs]# </pre> 
   </div> 
   <p><span>访问http://192.168.110.135:8889/,在分析地过程中,我将nginx_pod.yaml地hostPort: 8889改成了8889端口号哦。</span></p> 
   <p style="display:block;text-align:center;"></p> 
   <p style="display:block;text-align:center;"><a href="http://img.e-com-net.com/image/info8/28a71f4d555a482da7c6b5fc68f71386.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/28a71f4d555a482da7c6b5fc68f71386.jpg" alt="Kubernetes(k8s)之分布式文件系统glusterfs_第2张图片" width="650" height="305" style="border:1px solid black;"></a></p> 
   <p style="display:block;text-align:center;"></p> 
   <p><span>游戏是可以玩的,功能也算是搞完了。</span></p> 
  </div> 
 </div> 
</div>
                            </div>
                        </div>
                    </div>
                    <!--PC和WAP自适应版-->
                    <div id="SOHUCS" sid="1280677507992928256"></div>
                    <script type="text/javascript" src="/views/front/js/chanyan.js"></script>
                    <!-- 文章页-底部 动态广告位 -->
                    <div class="youdao-fixed-ad" id="detail_ad_bottom"></div>
                </div>
                <div class="col-md-3">
                    <div class="row" id="ad">
                        <!-- 文章页-右侧1 动态广告位 -->
                        <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_1"> </div>
                        </div>
                        <!-- 文章页-右侧2 动态广告位 -->
                        <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_2"></div>
                        </div>
                        <!-- 文章页-右侧3 动态广告位 -->
                        <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(Kubernetes(k8s)之分布式文件系统glusterfs)</h4>
        <div id="paradigm-article-related">
            <div class="recommend-post mb30">
                <ul class="widget-links">
                    <li><a href="/article/1881646095168237568.htm"
                           title="Android 内核开发之—— repo 使用教程" target="_blank">Android 内核开发之—— repo 使用教程</a>
                        <span class="text-muted">ByteSaid</span>
<a class="tag" taget="_blank" href="/search/Android/1.htm">Android</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91/1.htm">开发</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/git/1.htm">git</a>
                        <div>前言repo是一个用于管理多个Git仓库的工具,特别适用于管理大型项目如Android的源码。它是由Google开发的,用于解决多个Git仓库的同步、管理和代码审查等问题。因此,做Android内核开发,首先要了解repo是什么,它是如何使用的?1repo的概念repo是一种代码版本管理工具,它是由一系列的Python脚本组成,封装了一系列的Git命令,用来统一管理多个Git仓库。2repo的作用</div>
                    </li>
                    <li><a href="/article/1881626680548716544.htm"
                           title="《重生到现代之从零开始的C++生活》—— 类和对象2" target="_blank">《重生到现代之从零开始的C++生活》—— 类和对象2</a>
                        <span class="text-muted">yttandb</span>
<a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>类的默认成员函数默认成员函数就是用户没有显示实现,编译器会自动生成的成员函数,一个类会默认生成6个成员函数构造函数构造函数时特殊的成员函数,构造函数的初始化对象函数名与类名相同没有返回值对象实例化的时候胡自动调用构造函数构造函数可以重载如果类中没有显式定义函数,会自动生成一个无参的默认构造函数classa{public:add(inta.intb){returna+b;}a(){_a=1;_b=1</div>
                    </li>
                    <li><a href="/article/1881618735421255680.htm"
                           title="5g网络架构_【5G网络架构】系列之五:5G核心网向to B演进" target="_blank">5g网络架构_【5G网络架构】系列之五:5G核心网向to B演进</a>
                        <span class="text-muted">weixin_39980298</span>
<a class="tag" taget="_blank" href="/search/5g%E7%BD%91%E7%BB%9C%E6%9E%B6%E6%9E%84/1.htm">5g网络架构</a>
                        <div>编者按:前面推文小编简要介绍了移动通信核心网的发展历程,以及变得“妈都不认识了”5G核心网。然而,toB业务才是5G的核心业务,本期我们看下5G核心网是如何向toB业务演进的。根据3GPP标准组织定义,5G网络的大脑——核心网发生了空前变化。首先,5G核心网原生支持控制面和用户面彻底分离,使得用户面UPF可灵活下沉,与边缘计算(MEC)一起分布式部署于更靠近用户和数据源的位置,从而可降低网络时延,</div>
                    </li>
                    <li><a href="/article/1881588831564656640.htm"
                           title="《重生到现代之从零开始的C++生活》—— 入门基础语法2" target="_blank">《重生到现代之从零开始的C++生活》—— 入门基础语法2</a>
                        <span class="text-muted">yttandb</span>
<a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/%E7%94%9F%E6%B4%BB/1.htm">生活</a>
                        <div>缺省参数缺省参数就是在函数的声明和定义里制定一个缺省值,如果没有指定的实参就用该形参的缺省值voidadd(inta=0,intb=0){returna+b;}简单的的说就是将形式参数附一个值,如果没有实参传入的话,就默认用形参的值voidadd(inta=0,intb=3){returna+b;}intmain(){inta=1;intb=5;add(a,b);//结果为6add(a);//结果</div>
                    </li>
                    <li><a href="/article/1881588705118973952.htm"
                           title="《重生到现代之从零开始的数据结构生活》—— 复杂度" target="_blank">《重生到现代之从零开始的数据结构生活》—— 复杂度</a>
                        <span class="text-muted">yttandb</span>
<a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a>
                        <div>前言进入代码世界已经有一阵了,C语言学的差不多了打算看看数据结构以前都没想过我能学到这嘞哈哈哈哈所以,《重生到现代之从零开始的数据结构生活》开始啦数据结构我们天天说数据结构怎么怎么了,那什么是数据结构你知道吗数据结构(DataStructure)是计算机存储、组织数据的⽅式,指相互之间存在⼀种或多种特定关系的数据元素的集合这么说可能有点抽象了,但是如果举一个例子:intarr[3]={0};不就是</div>
                    </li>
                    <li><a href="/article/1881588452894502912.htm"
                           title="《重生到现代之从零开始的C语言生活》——C语言的数据类型和变量" target="_blank">《重生到现代之从零开始的C语言生活》——C语言的数据类型和变量</a>
                        <span class="text-muted">yttandb</span>
<a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a><a class="tag" taget="_blank" href="/search/%E7%94%9F%E6%B4%BB/1.htm">生活</a>
                        <div>C语言的数据类型和变量数据类型C语言中的数据类新用来描述数据,而类型可以理解为是数据的分类。数据类型可以分为以下几个内置类型字符型整型浮点型布尔类型自定义类型数组结构体-struct枚举-enum联合体-union在下面我们着重讲解内置类型字符型char可以创建一个字符型的变量(变量会在下文进行描述,在这知道即可)整形短整型shortint整形int长整型longint更长的整形longlongi</div>
                    </li>
                    <li><a href="/article/1881570541924577280.htm"
                           title="IOS开发之沙盒机制和文件操作" target="_blank">IOS开发之沙盒机制和文件操作</a>
                        <span class="text-muted">liudongshizhang</span>
<a class="tag" taget="_blank" href="/search/IOS%E5%BC%80%E5%8F%91/1.htm">IOS开发</a>
                        <div>引用于https://www.jianshu.com/p/d1715cad3d00沙盒也叫沙箱,英文standbox,其原理是通过重定向技术,把程序生成和修改的文件定向到自身文件夹中。每个iOS应用程序在安装时,都会创建属于自己的沙盒文件,应用程序不能直接访问其他应用程序的沙盒文件,当应用程序需要向外部请求或接收数据时,都需要经过权限认证,否则,无法获取到数据。即在沙盒机制下,每个程序之间的文件夹</div>
                    </li>
                    <li><a href="/article/1881561823883358208.htm"
                           title="Spring之定时任务基本使用篇" target="_blank">Spring之定时任务基本使用篇</a>
                        <span class="text-muted"></span>
<a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AFspringboot/1.htm">后端springboot</a>
                        <div>Spring之定时任务基本使用篇spring-boot项目中,想添加一个定时任务,可以怎么办?不管什么项目,都是可以直接用JDK原生的定时任务来实现借助@Scheduled注解来使用本篇博文则主要集中在在SpringBoot项目中,怎么使用定时任务I.基本使用demo在SpringBoot项目中,使用定时任务需要先开启对应的配置,一个简单的demo如下代码解读复制代码@EnableScheduli</div>
                    </li>
                    <li><a href="/article/1881560203158155264.htm"
                           title="FinOps之智能分账,助力企业全面透析和优化云成本" target="_blank">FinOps之智能分账,助力企业全面透析和优化云成本</a>
                        <span class="text-muted">奇墨 ITQM</span>
<a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E8%AE%A1%E7%AE%97/1.htm">云计算</a><a class="tag" taget="_blank" href="/search/%E8%87%AA%E5%8A%A8%E5%8C%96/1.htm">自动化</a>
                        <div>随着企业纷纷上云,云计算的按需付费、弹性扩展等优势为企业带来了极大的便利。然而,随之而来的云账单问题也逐渐浮出水面。本文将探讨企业上云后遇到的云账单问题,以及如何利用FinOps实现云账单的自动化分账对账,从而全面透析和优化云成本。一、企业上云后遇到的云账单问题随着企业业务规模的不断扩大,云资源消耗也持续增长,云账单的复杂性和管理难度相应上升。企业上云后,往往会遇到以下问题:1.云资源浪费:由于缺</div>
                    </li>
                    <li><a href="/article/1881555039273676800.htm"
                           title="用大数据“喂养”出来的AI模型ChatGPT 爆火是大数据、大算力、强算法的支撑,中国缺乏的什么?" target="_blank">用大数据“喂养”出来的AI模型ChatGPT 爆火是大数据、大算力、强算法的支撑,中国缺乏的什么?</a>
                        <span class="text-muted">Ai17316391579</span>
<a class="tag" taget="_blank" href="/search/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">深度学习服务器</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a>
                        <div>先来了解一下ChatGPT的基本情况ChatGPT本质属于生成式人工智能,属于无监督或半监督的机器学习。与之相关的还有Discriminativemodeling区分式模型,区分式模型大多属于监督式学习。生成性人工智能目前有两种主要的框架:GAN(GenerativeAdversarialNetwork)和GPT(GenerativePre-trainedTransformer)。GAN目前广泛应</div>
                    </li>
                    <li><a href="/article/1881534466598432768.htm"
                           title="K8S中Pod控制器之CronJob(CJ)控制器" target="_blank">K8S中Pod控制器之CronJob(CJ)控制器</a>
                        <span class="text-muted">元气满满的热码式</span>
<a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>CronJob控制器是Kubernetes中用于周期性执行任务的一种控制器,它基于Job控制器来创建和管理作业。以下是CronJob的一些关键特点:周期性调度:CronJob允许您定义一个基于时间的调度,类似于Linux的cron工具,来周期性地执行任务。时间点触发:CronJob根据指定的时间表(cron表达式)触发,可以精确到分钟。一次性或重复执行:尽管CronJob主要用于重复性任务,但它也</div>
                    </li>
                    <li><a href="/article/1881532576716353536.htm"
                           title="k8s部署Kafka集群" target="_blank">k8s部署Kafka集群</a>
                        <span class="text-muted">潞哥的博客</span>
<a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/kafka/1.htm">kafka</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>1.1、Kafka(消息队列)是一个分布式消息中间件,支持分区的、多副本的、多订阅者的、基于zookeeper协调的分布式消息系统。通俗来说:kafka就是一个存储系统,存储的数据形式为“消息";1.2、常用的消息系统有哪些以及各自的特点有activemq,rabbitmq,rocketmq,kafka1.3、为什么使用消息队列1)、提高扩展性:因为消息队列解耦了处理过程,有新增需求时只要另外增加</div>
                    </li>
                    <li><a href="/article/1881531941644201984.htm"
                           title="在 Kubernetes 上快速安装 KubeSphere v4.1.2" target="_blank">在 Kubernetes 上快速安装 KubeSphere v4.1.2</a>
                        <span class="text-muted">喝醉酒的小白</span>
<a class="tag" taget="_blank" href="/search/K8s/1.htm">K8s</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>目录标题安装文档配置repo安装使用插件安装文档在Kubernetes上快速安装KubeSphere配置repoexporthttps_proxy=10.10.x.x:7890helmrepoaddstablehttps://charts.helm.sh/stablehelmrepoupdate安装helmupgrade--install-nkubesphere-system--create-na</div>
                    </li>
                    <li><a href="/article/1881531185436356608.htm"
                           title="【1000个GDB技巧之】GDB中使用python脚本的方法以及4个注意事项(define、python、end、gdb.execute、to_string=True)" target="_blank">【1000个GDB技巧之】GDB中使用python脚本的方法以及4个注意事项(define、python、end、gdb.execute、to_string=True)</a>
                        <span class="text-muted">北冥的备忘录</span>
<a class="tag" taget="_blank" href="/search/Linux%E8%B0%83%E8%AF%95%E6%96%B9%E6%B3%95/1.htm">Linux调试方法</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E8%B0%83%E8%AF%95/1.htm">调试</a><a class="tag" taget="_blank" href="/search/gdb/1.htm">gdb</a>
                        <div>要点使用define定义函数在define中使用python…end包围python使用的代码(python代码也可以不在包围中)在python中使用gdb命令用gdb.execute,并且需要指定to_stringsgdb可以单独写成文件然后source进来坑:坑1:python和gdb的end都不值直接注释,需要另起一行坑2:gdb.execute执行后的输出结果包括$xxx获取需要做转换坑3</div>
                    </li>
                    <li><a href="/article/1881524747062276096.htm"
                           title="K8S环境快速部署Kafka(K8S外部可访问)" target="_blank">K8S环境快速部署Kafka(K8S外部可访问)</a>
                        <span class="text-muted">2401_83817392</span>
<a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/kafka/1.htm">kafka</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>apiVersion:v1kind:Servicemetadata:name:zookeeper-nodeportnamespace:kafka-testspec:type:NodePortports:port:2181nodePort:32181selector:app:zookeeperrelease:kafka执行命令:kubectlapply-fzookeeper-nodeport-svc</div>
                    </li>
                    <li><a href="/article/1881524369012879360.htm"
                           title="哈希算法篇——散落的秘密与精准的归宿,混沌中的秩序之美(上)" target="_blank">哈希算法篇——散落的秘密与精准的归宿,混沌中的秩序之美(上)</a>
                        <span class="text-muted">诚丞成</span>
<a class="tag" taget="_blank" href="/search/%E5%B8%B8%E7%94%A8%E7%AE%97%E6%B3%95%E8%AE%B2%E8%A7%A3/1.htm">常用算法讲解</a><a class="tag" taget="_blank" href="/search/%E5%93%88%E5%B8%8C%E7%AE%97%E6%B3%95/1.htm">哈希算法</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a>
                        <div>文章目录引言:混沌中的秩序之美第一章:哈希的本质——化繁为简的魔法第二章:经典哈希函数——一座算法的博物馆第三章:哈希表的奇迹——从无序到有序的转变3.1哈希函数的基本实现3.2基本的哈希表实现3.3哈希算法的实际应用小结引言:混沌中的秩序之美在信息科学的星空下,有一种算法宛如一位洞悉混沌的智者,能够以其独特的规则,在无限的可能性中找到秩序。这便是哈希算法(HashingAlgorithm),一个</div>
                    </li>
                    <li><a href="/article/1881516810101125120.htm"
                           title="云原生周刊:K8s 生产环境架构设计及成本分析" target="_blank">云原生周刊:K8s 生产环境架构设计及成本分析</a>
                        <span class="text-muted">KubeSphere 云原生</span>
<a class="tag" taget="_blank" href="/search/k8s/1.htm">k8s</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8%E5%B9%B3%E5%8F%B0/1.htm">容器平台</a><a class="tag" taget="_blank" href="/search/kubesphere/1.htm">kubesphere</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E8%AE%A1%E7%AE%97/1.htm">云计算</a>
                        <div>开源项目推荐KubeZoneNetKubeZoneNet旨在帮助监控和优化Kubernetes集群中的跨可用区(Cross-Zone)网络流量。这个项目提供了一种简便的方式来跟踪和分析Kubernetes集群中跨不同可用区的通信,帮助用户优化集群的网络架构、提高资源利用效率并减少网络延迟。通过实时监控和数据分析,KubeZoneNet能有效地识别跨可用区的网络瓶颈,并提供改进建议,以支持Kuber</div>
                    </li>
                    <li><a href="/article/1881493596121657344.htm"
                           title="我的软件架构师——Java 职位面试经历。" target="_blank">我的软件架构师——Java 职位面试经历。</a>
                        <span class="text-muted">小蜗牛慢慢爬行</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/%E8%81%8C%E5%9C%BA%E5%92%8C%E5%8F%91%E5%B1%95/1.htm">职场和发展</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a>
                        <div>最近,我参加了一家领先的服务型公司的软件架构师(Java)职位的面试。我在这里分享了一些面试官问我的问题。我只列出了与Java相关的问题,因为本文主要关注Java。面试官问我有关AWS、Docker、Kubernetes、Kafka、ElasticSearch、SQL/NoSQL和设计模式的问题。ClassNotFoundException和NoClassDefFoundError有什么区别?当您</div>
                    </li>
                    <li><a href="/article/1881489047508021248.htm"
                           title="为AI聊天工具添加一个知识系统 之40 总纲领和整体设计 之2 三种簿册(账簿/电话簿/户口簿)" target="_blank">为AI聊天工具添加一个知识系统 之40 总纲领和整体设计 之2 三种簿册(账簿/电话簿/户口簿)</a>
                        <span class="text-muted">一水鉴天</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E8%AF%AD%E8%A8%80/1.htm">人工语言</a><a class="tag" taget="_blank" href="/search/%E8%BD%AF%E4%BB%B6%E6%99%BA%E8%83%BD/1.htm">软件智能</a><a class="tag" taget="_blank" href="/search/%E6%99%BA%E8%83%BD%E5%88%B6%E9%80%A0/1.htm">智能制造</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a>
                        <div>本文要点前面给出的是项目式开发的项目“口号”,有点像包治百病的“万金油”。但在原型(原型式开发的一个原型口号)上分别有三个口号--注意:它们的表达和项目口号完全不同。逻辑上:所有模型model都是错的,但某些模型是有用的。数学上:所有程序prcedure严格来讲都是不精确的,但是有些程序非常接近用户的预期;语言上:所有表达expression都是含糊的,但任何语言都具有巨大的表达力。现在剩下的就是</div>
                    </li>
                    <li><a href="/article/1881488921028784128.htm"
                           title="为AI聊天工具添加一个知识系统 之33 通用项目文档模板 :语言无关/实现无关/符号无关的纯粹的符号学原型" target="_blank">为AI聊天工具添加一个知识系统 之33 通用项目文档模板 :语言无关/实现无关/符号无关的纯粹的符号学原型</a>
                        <span class="text-muted">一水鉴天</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E8%AF%AD%E8%A8%80/1.htm">人工语言</a><a class="tag" taget="_blank" href="/search/%E8%BD%AF%E4%BB%B6%E6%99%BA%E8%83%BD/1.htm">软件智能</a><a class="tag" taget="_blank" href="/search/%E6%99%BA%E8%83%BD%E5%88%B6%E9%80%A0/1.htm">智能制造</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/cocoa/1.htm">cocoa</a>
                        <div>本文要点要点提取本项目文档的三个部分(Part1公理化&个性化,Part2形式化&结构化,Part3自动化&智能化)应该给出三种限界上下文--分别确定了语言自由交流用户与访问上下文(语言)、敏捷开发上下文(程序)和稳固核心上下文(数据)。限界上下文是解决边缘模糊的对策--通过分界。它不同于为计算机分类和人类理解两个目的而分别设计的上下文映射和通用语言。但即使是这个扩大了的范围仍然是领域驱动设计DD</div>
                    </li>
                    <li><a href="/article/1881488794784428032.htm"
                           title="智能工厂的设计软件 应用场景的一个例子:为AI聊天工具添加一个知识系统 之14 方案再探 之5:知识树三类节点对应的三种网络形式及其网络主机" target="_blank">智能工厂的设计软件 应用场景的一个例子:为AI聊天工具添加一个知识系统 之14 方案再探 之5:知识树三类节点对应的三种网络形式及其网络主机</a>
                        <span class="text-muted">一水鉴天</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E8%AF%AD%E8%A8%80/1.htm">人工语言</a><a class="tag" taget="_blank" href="/search/%E6%99%BA%E8%83%BD%E5%88%B6%E9%80%A0/1.htm">智能制造</a><a class="tag" taget="_blank" href="/search/%E8%BD%AF%E4%BB%B6%E6%99%BA%E8%83%BD/1.htm">软件智能</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a>
                        <div>本文要点前面讨论过(前面有错这里做了修正),三种簿册归档对应通过不同的网络形式(分布式、对等式和去中心式)。每种网络主机上分别提供:分布式控制脚本、对等式账本和备记手本通过以上讨论,div模型已经涵盖以下内容:从内容提供者(某个AI聊天工具,特定接口)到知识树及其三种节点(通用接口)到网络主机及其三种网络形式(节点专属操作接口)的要求。后面需要进一步为三者设计一个能实现耦合和解耦的程序需要特别说明</div>
                    </li>
                    <li><a href="/article/1881485894616150016.htm"
                           title="设计模式-解释器模式" target="_blank">设计模式-解释器模式</a>
                        <span class="text-muted">夏旭泽</span>
<a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/1.htm">设计模式</a><a class="tag" taget="_blank" href="/search/%E8%A7%A3%E9%87%8A%E5%99%A8%E6%A8%A1%E5%BC%8F/1.htm">解释器模式</a>
                        <div>背景四则运算问题:先输入表达式的形式如a+b+c-d,然后分别输入变量的值,最后输出结果。传统模式:编写一个方法,接收表达式的形式,分析表达式,再根据分析结果执行相关操作。问题:不利于拓展,耦合性高,(如果想要加入乘法运算需要修改很多地方)基本介绍给定一个语言(表达式),定义他的文法的一种表示,并定义解释器,使用解释器解释语言。最常见的例子:编译器四个角色①context:是环境角色,含有解释器之</div>
                    </li>
                    <li><a href="/article/1881479589369278464.htm"
                           title="咱们继续学Java——高级篇 第一百九十八篇:之Java 2D中的区域与笔划知识详解" target="_blank">咱们继续学Java——高级篇 第一百九十八篇:之Java 2D中的区域与笔划知识详解</a>
                        <span class="text-muted">一杯年华@编程空间</span>
<a class="tag" taget="_blank" href="/search/%E5%92%B1%E4%BB%AC%E7%BB%A7%E7%BB%AD%E5%AD%A6java%E9%AB%98%E7%BA%A7%E7%AF%87/1.htm">咱们继续学java高级篇</a><a class="tag" taget="_blank" href="/search/struts/1.htm">struts</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/java-ee/1.htm">java-ee</a><a class="tag" taget="_blank" href="/search/jetty/1.htm">jetty</a><a class="tag" taget="_blank" href="/search/junit/1.htm">junit</a><a class="tag" taget="_blank" href="/search/log4j/1.htm">log4j</a><a class="tag" taget="_blank" href="/search/servlet/1.htm">servlet</a>
                        <div>咱们继续学Java——高级篇第一百九十八篇:之Java2D中的区域与笔划知识详解在Java的学习征程中,每一个知识点都是我们积累经验、提升能力的基石。我写这篇博客的目的,就是希望能与各位一同探索Java编程的奇妙世界,共同在这个领域中取得进步。今天,我们将聚焦于Java2D中的区域和笔划相关知识,深入了解这些概念和操作,相信这会让你在图形绘制方面有更多的技巧和方法。Path2D类的方法介绍java</div>
                    </li>
                    <li><a href="/article/1881478454654857216.htm"
                           title="Python 数据类型之数字型" target="_blank">Python 数据类型之数字型</a>
                        <span class="text-muted">梅子大魔王</span>
<a class="tag" taget="_blank" href="/search/python%E5%85%A8%E6%A0%88%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/1.htm">python全栈学习笔记</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a>
                        <div>Python数据类型之数字型1.整型int1)整型的介绍2)整型的运算3)int()函数2.浮点型float1)浮点型的介绍2)浮点型的运算3)float()函数3.复数型complex1)复数的介绍2)复数的运算3)complex()函数4.布尔型1)布尔型的介绍2)布尔值的运算3)bool()函数数字类型在Pyhton中非常常见,经常用于数字之间的运算、大小比较、条件判断等等。数字类型包括:整</div>
                    </li>
                    <li><a href="/article/1881477572852772864.htm"
                           title="【2025】拥抱未来 砥砺前行" target="_blank">【2025】拥抱未来 砥砺前行</a>
                        <span class="text-muted">摔跤猫子</span>
<a class="tag" taget="_blank" href="/search/%E5%85%B6%E4%BB%96/1.htm">其他</a><a class="tag" taget="_blank" href="/search/%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/1.htm">年终总结</a><a class="tag" taget="_blank" href="/search/%E6%8B%A5%E6%8A%B1%E6%9C%AA%E6%9D%A5/1.htm">拥抱未来</a><a class="tag" taget="_blank" href="/search/%E7%A0%A5%E7%A0%BA%E5%89%8D%E8%A1%8C/1.htm">砥砺前行</a><a class="tag" taget="_blank" href="/search/%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83/1.htm">深度思考</a>
                        <div>2024是怎样的一年2024在历史画卷上是波澜壮阔的一年,人工智能的浪潮来临,涌现出无数国产大模型。22年11月ChatGPT发布,它的出现如同在平静湖面上投下一颗巨石,激起了层层波澜,短短五天用户数就达到了100万,让整个世界为之侧目的同时也掀起了一场AI技术竞赛的浪潮。面对大模型这一蓝海,各方力量都试图搭上这趟时代的列车,争先恐后的相继开启布局。公司大模型名称发布时间澜舟科技孟子GPTV120</div>
                    </li>
                    <li><a href="/article/1881476559638949888.htm"
                           title="服务器物理机如何实现系统快照,Lvm快照实现物理备份之自动化" target="_blank">服务器物理机如何实现系统快照,Lvm快照实现物理备份之自动化</a>
                        <span class="text-muted">陶宇飞</span>
<a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%89%A9%E7%90%86%E6%9C%BA%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E7%B3%BB%E7%BB%9F%E5%BF%AB%E7%85%A7/1.htm">服务器物理机如何实现系统快照</a>
                        <div>环境:一台刚刚干净的linux服务器,使用centos系统create_kz.sh创建Lvm快照,实现备份#!/usr/bin/bash#创建一个lvm快照read-p'请输入新加磁盘的名字:'cpnamea=`lsblk|grep'sdb'|wc-l`if[!$a-eq1]thenecho'---'>/sys/class/scsi_host/host0/scanecho'---'>/sys/cl</div>
                    </li>
                    <li><a href="/article/1881465085398937600.htm"
                           title="Kubernetes(k8s) 架构设计" target="_blank">Kubernetes(k8s) 架构设计</a>
                        <span class="text-muted">boonya</span>
<a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/k8s/1.htm">k8s</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a>
                        <div>目录节点管理节点自注册手动节点管理节点状态地址状况容量与可分配信息节点控制器节点容量节点拓扑节点体面关闭接下来控制面到节点通信节点到控制面控制面到节点API服务器到kubeletapiserver到节点、Pod和服务SSH隧道Konnectivity服务控制器控制器模式通过API服务器来控制直接控制期望状态与当前状态设计运行控制器的方式接下来云控制器管理器的基础概念设计云控制器管理器的功能节点控制</div>
                    </li>
                    <li><a href="/article/1881462185243242496.htm"
                           title="k8s部署rabbitmq集群(使用rabbitmq-cluster-operator部署)" target="_blank">k8s部署rabbitmq集群(使用rabbitmq-cluster-operator部署)</a>
                        <span class="text-muted">仇誉</span>
<a class="tag" taget="_blank" href="/search/rabbitmq/1.htm">rabbitmq</a><a class="tag" taget="_blank" href="/search/rabbitmq/1.htm">rabbitmq</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a>
                        <div>1.下载并安装cluster-operatorkubectlapply-frabbitmq-cluster-operator.yml百度网盘请输入提取码:qy992.部署rabbitmq实例kubectlapply-frabbitmq.yaml存储类改为自己的(如:managed-nfs-storage)#rabbitmq.yaml---apiVersion:rabbitmq.com/v1beta</div>
                    </li>
                    <li><a href="/article/1881457522456457216.htm"
                           title="【从零开始入门unity游戏开发之——C#篇46】C#补充知识点——命名参数和可选参数" target="_blank">【从零开始入门unity游戏开发之——C#篇46】C#补充知识点——命名参数和可选参数</a>
                        <span class="text-muted">向宇it</span>
<a class="tag" taget="_blank" href="/search/unity/1.htm">unity</a><a class="tag" taget="_blank" href="/search/c%23/1.htm">c#</a><a class="tag" taget="_blank" href="/search/%E6%B8%B8%E6%88%8F%E5%BC%95%E6%93%8E/1.htm">游戏引擎</a><a class="tag" taget="_blank" href="/search/%E7%BC%96%E8%BE%91%E5%99%A8/1.htm">编辑器</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>考虑到每个人基础可能不一样,且并不是所有人都有同时做2D、3D开发的需求,所以我把【零基础入门unity游戏开发】分为成了C#篇、unity通用篇、unity3D篇、unity2D篇。【C#篇】:主要讲解C#的基础语法,包括变量、数据类型、运算符、流程控制、面向对象等,适合没有编程基础的同学入门。【unity通用篇】:主要讲解unity的基础通用的知识,包括unity界面、unity脚本、unit</div>
                    </li>
                    <li><a href="/article/1881456638766936064.htm"
                           title="Kubernetes架构原则和对象设计(二)" target="_blank">Kubernetes架构原则和对象设计(二)</a>
                        <span class="text-muted">grahamzhu</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F%E5%AD%A6%E4%B9%A0%E4%B8%93%E6%A0%8F/1.htm">云原生学习专栏</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84/1.htm">架构</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a><a class="tag" taget="_blank" href="/search/%E9%9B%86%E7%BE%A4%E6%90%AD%E5%BB%BA/1.htm">集群搭建</a><a class="tag" taget="_blank" href="/search/API%E8%AE%BE%E8%AE%A1/1.htm">API设计</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E8%AE%A1%E7%AE%97/1.htm">云计算</a><a class="tag" taget="_blank" href="/search/kubelet/1.htm">kubelet</a>
                        <div>云原生学习路线导航页(持续更新中)kubernetes学习系列快捷链接Kubernetes架构原则和对象设计(一)Kubernetes常见问题解答本文从云计算架构发展入手,详细分析了kubernetes的生态系统、设计理念、分层架构、API设计原则、架构设计原则等,并介绍了使用kubelet+staticPod拉起集群的过程1.云计算的传统分类云计算出现之前,对于任何企业,想要搭建自己的服务,需要</div>
                    </li>
                                <li><a href="/article/33.htm"
                                       title="Spring的注解积累" target="_blank">Spring的注解积累</a>
                                    <span class="text-muted">yijiesuifeng</span>
<a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/%E6%B3%A8%E8%A7%A3/1.htm">注解</a>
                                    <div>用注解来向Spring容器注册Bean。 
  
需要在applicationContext.xml中注册: 
<context:component-scan base-package=”pagkage1[,pagkage2,…,pagkageN]”/>。 
如:在base-package指明一个包    
<context:component-sc</div>
                                </li>
                                <li><a href="/article/160.htm"
                                       title="传感器" target="_blank">传感器</a>
                                    <span class="text-muted">百合不是茶</span>
<a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/%E4%BC%A0%E6%84%9F%E5%99%A8/1.htm">传感器</a>
                                    <div>android传感器的作用主要就是来获取数据,根据得到的数据来触发某种事件 
  
下面就以重力传感器为例; 
  
1,在onCreate中获得传感器服务 
  
private SensorManager sm;// 获得系统的服务
	private Sensor sensor;// 创建传感器实例

	@Override
	protected void </div>
                                </li>
                                <li><a href="/article/287.htm"
                                       title="[光磁与探测]金吕玉衣的意义" target="_blank">[光磁与探测]金吕玉衣的意义</a>
                                    <span class="text-muted">comsci</span>

                                    <div>      这是一个古代人的秘密:现在告诉大家 
 
      信不信由你们: 
 
      穿上金律玉衣的人,如果处于灵魂出窍的状态,可以飞到宇宙中去看星星 
 
      这就是为什么古代</div>
                                </li>
                                <li><a href="/article/414.htm"
                                       title="精简的反序打印某个数" target="_blank">精简的反序打印某个数</a>
                                    <span class="text-muted">沐刃青蛟</span>
<a class="tag" taget="_blank" href="/search/%E6%89%93%E5%8D%B0/1.htm">打印</a>
                                    <div>以前看到一些让求反序打印某个数的程序。 
比如:输入123,输出321。 
  
记得以前是告诉你是几位数的,当时就抓耳挠腮,完全没有思路。 
  
似乎最后是用到%和/方法解决的。 
  
而今突然想到一个简短的方法,就可以实现任意位数的反序打印(但是如果是首位数或者尾位数为0时就没有打印出来了) 
  
代码如下: 
	long num, num1=0;</div>
                                </li>
                                <li><a href="/article/541.htm"
                                       title="PHP:6种方法获取文件的扩展名" target="_blank">PHP:6种方法获取文件的扩展名</a>
                                    <span class="text-muted">IT独行者</span>
<a class="tag" taget="_blank" href="/search/PHP/1.htm">PHP</a><a class="tag" taget="_blank" href="/search/%E6%89%A9%E5%B1%95%E5%90%8D/1.htm">扩展名</a>
                                    <div>  
PHP:6种方法获取文件的扩展名 
  
1、字符串查找和截取的方法 
       1      
$extension 
= 
substr 
( 
strrchr 
( 
$file 
,  
'.' 
), 1);       
2、字符串查找和截取的方法二 
       1      
$extension 
= 
substr </div>
                                </li>
                                <li><a href="/article/668.htm"
                                       title="面试111" target="_blank">面试111</a>
                                    <span class="text-muted">文强chu</span>
<a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a>
                                    <div> 1事务隔离级别有那些 ,事务特性是什么(问到一次)
 2 spring aop 如何管理事务的,如何实现的。动态代理如何实现,jdk怎么实现动态代理的,ioc是怎么实现的,spring是单例还是多例,有那些初始化bean的方式,各有什么区别(经常问)
 3 struts默认提供了那些拦截器 (一次)
 4 过滤器和拦截器的区别 (频率也挺高)
 5 final,finally final</div>
                                </li>
                                <li><a href="/article/795.htm"
                                       title="XML的四种解析方式" target="_blank">XML的四种解析方式</a>
                                    <span class="text-muted">小桔子</span>
<a class="tag" taget="_blank" href="/search/dom/1.htm">dom</a><a class="tag" taget="_blank" href="/search/jdom/1.htm">jdom</a><a class="tag" taget="_blank" href="/search/dom4j/1.htm">dom4j</a><a class="tag" taget="_blank" href="/search/sax/1.htm">sax</a>
                                    <div>在平时工作中,难免会遇到把 XML 作为数据存储格式。面对目前种类繁多的解决方案,哪个最适合我们呢?在这篇文章中,我对这四种主流方案做一个不完全评测,仅仅针对遍历 XML 这块来测试,因为遍历 XML 是工作中使用最多的(至少我认为)。   预 备   测试环境:   AMD 毒龙1.4G OC 1.5G、256M DDR333、Windows2000 Server </div>
                                </li>
                                <li><a href="/article/922.htm"
                                       title="wordpress中常见的操作" target="_blank">wordpress中常见的操作</a>
                                    <span class="text-muted">aichenglong</span>
<a class="tag" taget="_blank" href="/search/%E4%B8%AD%E6%96%87%E6%B3%A8%E5%86%8C/1.htm">中文注册</a><a class="tag" taget="_blank" href="/search/wordpress/1.htm">wordpress</a><a class="tag" taget="_blank" href="/search/%E7%A7%BB%E9%99%A4%E8%8F%9C%E5%8D%95/1.htm">移除菜单</a>
                                    <div>1 wordpress中使用中文名注册解决办法 
  1)使用插件 
  2)修改wp源代码 
     进入到wp-include/formatting.php文件中找到 
      function sanitize_user( $username, $strict = false </div>
                                </li>
                                <li><a href="/article/1049.htm"
                                       title="小飞飞学管理-1" target="_blank">小飞飞学管理-1</a>
                                    <span class="text-muted">alafqq</span>
<a class="tag" taget="_blank" href="/search/%E7%AE%A1%E7%90%86/1.htm">管理</a>
                                    <div>项目管理的下午题,其实就在提出问题(挑刺),分析问题,解决问题。 
今天我随意看下10年上半年的第一题。主要就是项目经理的提拨和培养。 
结合我自己经历写下心得 
 
对于公司选拔和培养项目经理的制度有什么毛病呢? 
1,公司考察,选拔项目经理,只关注技术能力,而很少或没有关注管理方面的经验,能力。 
2,公司对项目经理缺乏必要的项目管理知识和技能方面的培训。 
3,公司对项目经理的工作缺乏进行指</div>
                                </li>
                                <li><a href="/article/1176.htm"
                                       title="IO输入输出部分探讨" target="_blank">IO输入输出部分探讨</a>
                                    <span class="text-muted">百合不是茶</span>
<a class="tag" taget="_blank" href="/search/IO/1.htm">IO</a>
                                    <div> 
 //文件处理  在处理文件输入输出时要引入java.IO这个包; 
/* 
1,运用File类对文件目录和属性进行操作 
2,理解流,理解输入输出流的概念 
3,使用字节/符流对文件进行读/写操作 
4,了解标准的I/O 
5,了解对象序列化 
*/ 
  
//1,运用File类对文件目录和属性进行操作 
  
//在工程中线创建一个text.txt</div>
                                </li>
                                <li><a href="/article/1303.htm"
                                       title="getElementById的用法" target="_blank">getElementById的用法</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/element/1.htm">element</a>
                                    <div>        getElementById是通过Id来设置/返回HTML标签的属性及调用其事件与方法。用这个方法基本上可以控制页面所有标签,条件很简单,就是给每个标签分配一个ID号。 
       返回具有指定ID属性值的第一个对象的一个引用。 
       语法: 
&n</div>
                                </li>
                                <li><a href="/article/1430.htm"
                                       title="励志经典语录" target="_blank">励志经典语录</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/%E5%8A%B1%E5%BF%97/1.htm">励志</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E7%94%9F/1.htm">人生</a>
                                    <div>经典语录1:  
  哈佛有一个著名的理论:人的差别在于业余时间,而一个人的命运决定于晚上8点到10点之间。每晚抽出2个小时的时间用来阅读、进修、思考或参加有意的演讲、讨论,你会发现,你的人生正在发生改变,坚持数年之后,成功会向你招手。不要每天抱着QQ/MSN/游戏/电影/肥皂剧……奋斗到12点都舍不得休息,看就看一些励志的影视或者文章,不要当作消遣;学会思考人生,学会感悟人生</div>
                                </li>
                                <li><a href="/article/1557.htm"
                                       title="[MongoDB学习笔记三]MongoDB分片" target="_blank">[MongoDB学习笔记三]MongoDB分片</a>
                                    <span class="text-muted">bit1129</span>
<a class="tag" taget="_blank" href="/search/mongodb/1.htm">mongodb</a>
                                    <div>MongoDB的副本集(Replica Set)一方面解决了数据的备份和数据的可靠性问题,另一方面也提升了数据的读写性能。MongoDB分片(Sharding)则解决了数据的扩容问题,MongoDB作为云计算时代的分布式数据库,大容量数据存储,高效并发的数据存取,自动容错等是MongoDB的关键指标。 
本篇介绍MongoDB的切片(Sharding) 
  1.何时需要分片 
&nbs</div>
                                </li>
                                <li><a href="/article/1684.htm"
                                       title="【Spark八十三】BlockManager在Spark中的使用场景" target="_blank">【Spark八十三】BlockManager在Spark中的使用场景</a>
                                    <span class="text-muted">bit1129</span>
<a class="tag" taget="_blank" href="/search/manager/1.htm">manager</a>
                                    <div>1. Broadcast变量的存储,在HttpBroadcast类中可以知道 
2. RDD通过CacheManager存储RDD中的数据,CacheManager也是通过BlockManager进行存储的 
3. ShuffleMapTask得到的结果数据,是通过FileShuffleBlockManager进行管理的,而FileShuffleBlockManager最终也是使用BlockMan</div>
                                </li>
                                <li><a href="/article/1811.htm"
                                       title="yum方式部署zabbix" target="_blank">yum方式部署zabbix</a>
                                    <span class="text-muted">ronin47</span>
<a class="tag" taget="_blank" href="/search/yum%E6%96%B9%E5%BC%8F%E9%83%A8%E7%BD%B2zabbix/1.htm">yum方式部署zabbix</a>
                                    <div>安装网络yum库#rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm 通过yum装mysql和zabbix调用的插件还有agent代理#yum install zabbix-server-mysql zabbix-web-mysql mysql-</div>
                                </li>
                                <li><a href="/article/1938.htm"
                                       title="Hibernate4和MySQL5.5自动创建表失败问题解决方法" target="_blank">Hibernate4和MySQL5.5自动创建表失败问题解决方法</a>
                                    <span class="text-muted">byalias</span>
<a class="tag" taget="_blank" href="/search/J2EE/1.htm">J2EE</a><a class="tag" taget="_blank" href="/search/Hibernate4/1.htm">Hibernate4</a>
                                    <div>今天初学Hibernate4,了解了使用Hibernate的过程。大体分为4个步骤: 
①创建hibernate.cfg.xml文件 
②创建持久化对象 
③创建*.hbm.xml映射文件 
④编写hibernate相应代码 
在第四步中,进行了单元测试,测试预期结果是hibernate自动帮助在数据库中创建数据表,结果JUnit单元测试没有问题,在控制台打印了创建数据表的SQL语句,但在数据库中</div>
                                </li>
                                <li><a href="/article/2065.htm"
                                       title="Netty源码学习-FrameDecoder" target="_blank">Netty源码学习-FrameDecoder</a>
                                    <span class="text-muted">bylijinnan</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/netty/1.htm">netty</a>
                                    <div>Netty 3.x的user guide里FrameDecoder的例子,有几个疑问: 
 1.文档说:FrameDecoder calls decode method with an internally maintained cumulative buffer whenever new data is received. 
 为什么每次有新数据到达时,都会调用decode方法? 
 2.Dec</div>
                                </li>
                                <li><a href="/article/2192.htm"
                                       title="SQL行列转换方法" target="_blank">SQL行列转换方法</a>
                                    <span class="text-muted">chicony</span>
<a class="tag" taget="_blank" href="/search/%E8%A1%8C%E5%88%97%E8%BD%AC%E6%8D%A2/1.htm">行列转换</a>
                                    <div>  
  
create table tb(终端名称 varchar(10) , CEI分值 varchar(10) , 终端数量 int) 
insert into tb values('三星' , '0-5' , 74) 
insert into tb values('三星' , '10-15' , 83) 
insert into tb values('苹果' , '0-5' , 93) 
</div>
                                </li>
                                <li><a href="/article/2319.htm"
                                       title="中文编码测试" target="_blank">中文编码测试</a>
                                    <span class="text-muted">ctrain</span>
<a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A0%81/1.htm">编码</a>
                                    <div>循环打印转换编码 
 

String[] codes = {
    "iso-8859-1",
    "utf-8",
    "gbk",
    "unicode"
};

for (int i = 0; i < codes.length; i++) {
    for (int j </div>
                                </li>
                                <li><a href="/article/2446.htm"
                                       title="hive 客户端查询报堆内存溢出解决方法" target="_blank">hive 客户端查询报堆内存溢出解决方法</a>
                                    <span class="text-muted">daizj</span>
<a class="tag" taget="_blank" href="/search/hive/1.htm">hive</a><a class="tag" taget="_blank" href="/search/%E5%A0%86%E5%86%85%E5%AD%98%E6%BA%A2%E5%87%BA/1.htm">堆内存溢出</a>
                                    <div>hive> select * from t_test where ds=20150323 limit 2; 
OK 
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space 
  
问题原因: hive堆内存默认为256M 
  
这个问题的解决方法为: 
修改/us</div>
                                </li>
                                <li><a href="/article/2573.htm"
                                       title="人有多大懒,才有多大闲 (评论『卓有成效的程序员』)" target="_blank">人有多大懒,才有多大闲 (评论『卓有成效的程序员』)</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a>
                                    <div>  
卓有成效的程序员给我的震撼很大,程序员作为特殊的群体,有的人可以这么懒,  懒到事情都交给机器去做 ,而有的人又可以那么勤奋,每天都孜孜不倦得做着重复单调的工作。 
  
在看这本书之前,我属于勤奋的人,而看完这本书以后,我要努力变成懒惰的人。 
不要在去庞大的开始菜单里面一项一项搜索自己的应用程序,也不要在自己的桌面上放置眼花缭乱的快捷图标</div>
                                </li>
                                <li><a href="/article/2700.htm"
                                       title="Eclipse简单有用的配置" target="_blank">Eclipse简单有用的配置</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/eclipse/1.htm">eclipse</a>
                                    <div>1、显示行号  Window -- Prefences -- General -- Editors -- Text Editors -- show line numbers 
  
2、代码提示字符 Window ->Perferences,并依次展开 Java -> Editor -> Content Assist,最下面一栏 auto-Activation</div>
                                </li>
                                <li><a href="/article/2827.htm"
                                       title="在tomcat上面安装solr4.8.0全过程" target="_blank">在tomcat上面安装solr4.8.0全过程</a>
                                    <span class="text-muted">eksliang</span>
<a class="tag" taget="_blank" href="/search/Solr/1.htm">Solr</a><a class="tag" taget="_blank" href="/search/solr4.0%E5%90%8E%E7%9A%84%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85/1.htm">solr4.0后的版本安装</a><a class="tag" taget="_blank" href="/search/solr4.8.0%E5%AE%89%E8%A3%85/1.htm">solr4.8.0安装</a>
                                    <div>转载请出自出处:
http://eksliang.iteye.com/blog/2096478  
      首先solr是一个基于java的web的应用,所以安装solr之前必须先安装JDK和tomcat,我这里就先省略安装tomcat和jdk了 
        
第一步:当然是下载去官网上下载最新的solr版本,下载地址</div>
                                </li>
                                <li><a href="/article/2954.htm"
                                       title="Android APP通用型拒绝服务、漏洞分析报告" target="_blank">Android APP通用型拒绝服务、漏洞分析报告</a>
                                    <span class="text-muted">gg163</span>
<a class="tag" taget="_blank" href="/search/%E6%BC%8F%E6%B4%9E/1.htm">漏洞</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/APP/1.htm">APP</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E6%9E%90/1.htm">分析</a>
                                    <div>点评:记得曾经有段时间很多SRC平台被刷了大量APP本地拒绝服务漏洞,移动安全团队爱内测(ineice.com)发现了一个安卓客户端的通用型拒绝服务漏洞,来看看他们的详细分析吧。  
0xr0ot和Xbalien交流所有可能导致应用拒绝服务的异常类型时,发现了一处通用的本地拒绝服务漏洞。该通用型本地拒绝服务可以造成大面积的app拒绝服务。  
针对序列化对象而出现的拒绝服务主要</div>
                                </li>
                                <li><a href="/article/3081.htm"
                                       title="HoverTree项目已经实现分层" target="_blank">HoverTree项目已经实现分层</a>
                                    <span class="text-muted">hvt</span>
<a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B/1.htm">编程</a><a class="tag" taget="_blank" href="/search/.net/1.htm">.net</a><a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a><a class="tag" taget="_blank" href="/search/C%23/1.htm">C#</a><a class="tag" taget="_blank" href="/search/ASP.ENT/1.htm">ASP.ENT</a>
                                    <div>HoverTree项目已经初步实现分层,源代码已经上传到 http://hovertree.codeplex.com请到SOURCE CODE查看。在本地用SQL Server 2008 数据库测试成功。数据库和表请参考:http://keleyi.com/a/bjae/ue6stb42.htmHoverTree是一个ASP.NET 开源项目,希望对你学习ASP.NET或者C#语言有帮助,如果你对</div>
                                </li>
                                <li><a href="/article/3208.htm"
                                       title="Google Maps API v3: Remove Markers 移除标记" target="_blank">Google Maps API v3: Remove Markers 移除标记</a>
                                    <span class="text-muted">天梯梦</span>
<a class="tag" taget="_blank" href="/search/google+maps+api/1.htm">google maps api</a>
                                    <div>Simply do the following: 
  
I. Declare a global variable: 
var markersArray = []; 
  
II. Define a function: 
function clearOverlays() {
  for (var i = 0; i < markersArray.length; i++ )</div>
                                </li>
                                <li><a href="/article/3335.htm"
                                       title="jQuery选择器总结" target="_blank">jQuery选择器总结</a>
                                    <span class="text-muted">lq38366</span>
<a class="tag" taget="_blank" href="/search/jquery/1.htm">jquery</a><a class="tag" taget="_blank" href="/search/%E9%80%89%E6%8B%A9%E5%99%A8/1.htm">选择器</a>
                                    <div>       1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40</div>
                                </li>
                                <li><a href="/article/3462.htm"
                                       title="基础数据结构和算法六:Quick sort" target="_blank">基础数据结构和算法六:Quick sort</a>
                                    <span class="text-muted">sunwinner</span>
<a class="tag" taget="_blank" href="/search/Algorithm/1.htm">Algorithm</a><a class="tag" taget="_blank" href="/search/Quicksort/1.htm">Quicksort</a>
                                    <div>Quick sort is probably used more widely than any other. It is popular because it is not difficult to implement, works well for a variety of different kinds of input data, and is substantially faster t</div>
                                </li>
                                <li><a href="/article/3589.htm"
                                       title="如何让Flash不遮挡HTML div元素的技巧_HTML/Xhtml_网页制作" target="_blank">如何让Flash不遮挡HTML div元素的技巧_HTML/Xhtml_网页制作</a>
                                    <span class="text-muted">刘星宇</span>
<a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a>
                                    <div>今天在写一个flash广告代码的时候,因为flash自带的链接,容易被当成弹出广告,所以做了一个div层放到flash上面,这样链接都是a触发的不会被拦截,但发现flash一直处于div层上面,原来flash需要加个参数才可以。 
 
让flash置于DIV层之下的方法,让flash不挡住飘浮层或下拉菜单,让Flash不档住浮动对象或层的关键参数:wmode=opaque。 
 
方法如下: 
 </div>
                                </li>
                                <li><a href="/article/3716.htm"
                                       title="Mybatis实用Mapper SQL汇总示例" target="_blank">Mybatis实用Mapper SQL汇总示例</a>
                                    <span class="text-muted">wdmcygah</span>
<a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/%E5%AE%9E%E7%94%A8/1.htm">实用</a>
                                    <div>Mybatis作为一个非常好用的持久层框架,相关资料真的是少得可怜,所幸的是官方文档还算详细。本博文主要列举一些个人感觉比较常用的场景及相应的Mapper SQL写法,希望能够对大家有所帮助。 
不少持久层框架对动态SQL的支持不足,在SQL需要动态拼接时非常苦恼,而Mybatis很好地解决了这个问题,算是框架的一大亮点。对于常见的场景,例如:批量插入/更新/删除,模糊查询,多条件查询,联表查询,</div>
                                </li>
                </ul>
            </div>
        </div>
    </div>

<div>
    <div class="container">
        <div class="indexes">
            <strong>按字母分类:</strong>
            <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a
                href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a
                href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a
                href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a
                href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a
                href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a
                href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a
                href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a
                href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a>
        </div>
    </div>
</div>
<footer id="footer" class="mb30 mt30">
    <div class="container">
        <div class="footBglm">
            <a target="_blank" href="/">首页</a> -
            <a target="_blank" href="/custom/about.htm">关于我们</a> -
            <a target="_blank" href="/search/Java/1.htm">站内搜索</a> -
            <a target="_blank" href="/sitemap.txt">Sitemap</a> -
            <a target="_blank" href="/custom/delete.htm">侵权投诉</a>
        </div>
        <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved.
<!--            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>-->
        </div>
    </div>
</footer>
<!-- 代码高亮 -->
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/>
<script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script>





</body>

</html>