文件服务器fuse,分布式文件系统glusterfs安装步骤

2023-11-01

我的系统是 RHEL5 , 可能环境不一样, 需要安装的第三方依赖不一样啊, 反正大家在安装的过程中缺少什么就去安装什么, 一般都会有提示的。

下载   glusterfs-3.2.0.tar.gz  源码包。 随便解压到一个目录。

glusterfs 需要 fuse 的支持, 在安装开始之前请先安装 fuse。

fuse可以到进行下载

安装fuse的步骤如下:

./configure

make

make install

glusterfs 需要 ctypes 的支持, 在安装开始之前请先安装 ctypes。

ctypes看的下载地址为

ctypes库安装时需要使用 python,安装步骤如下

python setup.py build

python setup.py test

python setup.py install

安装glusterfs, 步骤如下:

cd  /home/glusterfs-3.2.0

./configure   --enable-fusermount

make

make install

下来需要进行配置,我这里的环境为 :

server端3台----------- 192.168.2.85  和  192.168.2.222  和  192.168.2.98

client 端1台------------192.168.2.55

配置文件所在的目录为  /etc/glusterfs/

[root@redhat1 glusterfs]# more protocol-server.vol

### Export volume "brick" with the contents of "/home/export" directory.

volume brick

type storage/posix                   # POSIX FS translator

option directory /data/movies        # Export this directory

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp      # For TCP/IP transport

option transport.socket.listen-port 24016

# option transport-type ib-verbs # For Infiniband Verbs transport

# option transport.ib-verbs.work-request-send-size  131072

# option transport.ib-verbs.work-request-send-count 64

# option transport.ib-verbs.work-request-recv-size  131072

# option transport.ib-verbs.work-request-recv-count 64

# option transport.ib-verbs.listen-port 24016

#  option bind-address 192.168.1.10     # Default is to listen on all interfaces

# option client-volume-filename /etc/glusterfs/glusterfs-client.vol

subvolumes brick

option auth.addr.brick.allow 192.168.* # Allow access to "brick" volume

end-volume

上面是  服务器端 的配置文件,每台服务器的配置都一样, 共享数据目录为 /data/movies

启动服务器端的命令为  :

glusterfsd  -l  /etc/glusterfs/g.log  -f  /etc/glusterfs/protocol-server.vol

下面的配置文件时客户端的配置文件:

volume client0

type protocol/client

option transport-type tcp     # for TCP/IP transport

# option transport-type ib-sdp  # for Infiniband transport

option remote-host 192.168.2.85     # IP address of the remote brick

option transport.socket.remote-port 24016

# option transport-type ib-verbs # for Infiniband verbs transport

# option transport.ib-verbs.work-request-send-size  1048576

# option transport.ib-verbs.work-request-send-count 16

# option transport.ib-verbs.work-request-recv-size  1048576

# option transport.ib-verbs.work-request-recv-count 16

# option transport.ib-verbs.remote-port 24016

option remote-subvolume brick        # name of the remote volume

# option transport-timeout 30          # default value is 120seconds

end-volume

volume client1

type protocol/client

option transport-type tcp     # for TCP/IP transport

# option transport-type ib-sdp  # for Infiniband transport

option remote-host 192.168.2.222     # IP address of the remote brick

option transport.socket.remote-port 24016

# option transport-type ib-verbs # for Infiniband verbs transport

# option transport.ib-verbs.work-request-send-size  1048576

# option transport.ib-verbs.work-request-send-count 16

# option transport.ib-verbs.work-request-recv-size  1048576

# option transport.ib-verbs.work-request-recv-count 16

# option transport.ib-verbs.remote-port 24016

option remote-subvolume brick        # name of the remote volume

# option transport-timeout 30          # default value is 120seconds

end-volume

volume client2

type protocol/client

option transport-type tcp     # for TCP/IP transport

# option transport-type ib-sdp  # for Infiniband transport

option remote-host 192.168.2.98     # IP address of the remote brick

option transport.socket.remote-port 24016

# option transport-type ib-verbs # for Infiniband verbs transport

# option transport.ib-verbs.work-request-send-size  1048576

# option transport.ib-verbs.work-request-send-count 16

# option transport.ib-verbs.work-request-recv-size  1048576

# option transport.ib-verbs.work-request-recv-count 16

# option transport.ib-verbs.remote-port 24016

option remote-subvolume brick        # name of the remote volume

# option transport-timeout 30          # default value is 120seconds

end-volume

volume unify

type cluster/distribute

subvolumes client0 client1 client2

end-volume

启动客户端的命令为:

glusterfs -l /etc/glusterfs/glusterfs.log -f /etc/glusterfs/protocol-client.vol /mnt

启动后可以检查  /etc/glusterfs/glusterfs.log 文件, 进行查看日志。

也可以用 df  -h 命令来查看,如下代表成功

glusterfs#/etc/glusterfs/protocol-client.vol

654G  133G  487G  22% /mnt

由于glusterfs 使用了 fuse, 所以就和使用本地的一个目录一样使用这个分布式的文件系统了。

不信你就执行一下   :

ls   /mnt

cp  /etc/glusterfs/protocol-client.vol   /mnt

ls  /mnt

祝大家工作愉快 !

在配置的过程中如果有什么问题, 大家还可以参考

http://hi.baidu.com/farmerluo/blog/category/Glusterfs

介绍的还是蛮详细的。

有多种对Gluster配置的方式,此处介绍三种.

1.在一台服务器上建立Distributed Volume

假设服务器为:192.168.113.173(Server)

假设客户端为:192.168.113.179(Client)

首先配置Server,开启gluster服务

Server# modprobe fuse

Server# /etc/init/glusterd start

服务器只有一台,直接创建Volume即可,名为single-volume

Server#gluster volume create single-volume 192.168.113.173:/home/single1

启动volume

Server# gluster volume start single-volume

查看当前所有volume状态

Server# gluster volume info

若要使用Cache,则使用

Server# gluster volume set single-volume performance.cache-size 1GB

Gluster自动生成配置文件,在/etc/glusterd/vols/single-volume/文件夹中

在客户端挂载gluster镜像,客户端直接使用Server端的配置文件,不必创建自己的配置文件了

Client# modprobe fuse

Client# /etc/init/glusterd start

Client# mount.glusterfs 192.168.113.173:/single-volume /mnt/local-volume

2.在两台服务器上建立Distributed Volume

假设服务器A为:192.168.113.173(ServerA)

假设服务器B为:192.168.113.174(ServerB)

假设客户端为:192.168.113.179(Client)

首先配置Server,开启gluster服务

ServerA# modprobe fuse

ServerA# /etc/init/glusterd start

ServerB# modprobe fuse

ServerB# /etc/init/glusterd start

服务器有两台,要先绑定在一起(假设使用ServerA做主服务器)

ServerA# gluster peer probe 192.168.113.174

创建Volume,名为cluster-volume

ServerA# gluster volume create cluster-volume 192.168.113.173:/home/cluster1 192.168.113.174:/home/cluster2

启动volume

ServerA# gluster volume start cluster-volume

查看当前所有volume状态

ServerA# gluster volume info

若要使用Cache,则使用

ServerA# gluster volume set cluster-volume performance.cache-size 1GB

Gluster自动生成配置文件,在/etc/glusterd/vols/cluster-volume/文件夹中

在客户端挂载gluster镜像,客户端直接使用Server端的配置文件,不必创建自己的配置文件了

Client# modprobe fuse

Client# /etc/init/glusterd start

Client# mount.glusterfs 192.168.113.173:/cluster-volume /mnt/local-volume

3.在两台服务器上建立Striped Volume

假设服务器A为:192.168.113.173(ServerA)

假设服务器B为:192.168.113.174(ServerB)

假设客户端为:192.168.113.179(Client)

首先配置Server,开启gluster服务

ServerA# modprobe fuse

ServerA# /etc/init/glusterd start

ServerB# modprobe fuse

ServerB# /etc/init/glusterd start

服务器有两台,要先绑定在一起(假设使用ServerA做主服务器)

ServerA# gluster peer probe 192.168.113.174

创建Volume,名为stripe-volume

ServerA# gluster volume create stripe-volume stripe 2 transport tcp 192.168.113.173:/home/stripe1 192.168.113.174:/home/stripe2

启动volume

ServerA# gluster volume start stripe-volume

查看当前所有volume状态

ServerA# gluster volume info

若要使用Cache,则使用

ServerA# gluster volume set stripe-volume performance.cache-size 1GB

Gluster自动生成配置文件,在/etc/glusterd/vols/stripe-volume/文件夹中

在客户端挂载gluster镜像,客户端直接使用Server端的配置文件,不必创建自己的配置文件了

Client# modprobe fuse

Client# /etc/init/glusterd start

Client# mount.glusterfs 192.168.113.173:/stripe-volume /mnt/local-volume

摘要:GlusterFS是Scale-Out存储解决方案Gluster的核心,它是一个开源的分布式文件系统,具有强大的横向扩展能力,通过扩展能够支持数PB存储容量和处理数千客户端。GlusterFS借助TCP/IP或InfiniBand RDMA网络将物理分布的存储资源聚集在一起,使用单一全局命名空间来管理数据。GlusterFS基于可堆叠的用户空间设计,可为各种不同的数据负载提供优异的性能。

相关阅读:

Glusterfs集群文件系统研究

Glusterfs全局统一命名空间

创建Glusterfs分布式RAID10卷

Glusterfs 3.4 Beta 发布,集群文件系统

Glusterfs Rebalance简析

设计新Xlator扩展GlusterFS

过去一直以为GlusterFS和GFS为同一个东西,真是惭愧。昨天一同事用到才发现它是个好东西!

安装很简单,在所有存储服务器上执行:

yum -y install glusterfs glusterfs-server

chkconfig glusterd on

service glusterd start

将存储节点组合成一个集群,笔者以18节点为例。只需要在任一个节点执行:

gluster peer probe agent21.kisops.org

gluster peer probe agent22.kisops.org

gluster peer probe agent23.kisops.org

gluster peer probe agent24.kisops.org

gluster peer probe agent25.kisops.org

gluster peer probe agent26.kisops.org

gluster peer probe agent27.kisops.org

gluster peer probe agent28.kisops.org

gluster peer probe agent29.kisops.org

gluster peer probe agent30.kisops.org

gluster peer probe agent31.kisops.org

gluster peer probe agent32.kisops.org

gluster peer probe agent33.kisops.org

gluster peer probe agent34.kisops.org

gluster peer probe agent35.kisops.org

gluster peer probe agent36.kisops.org

gluster peer probe agent37.kisops.org

gluster peer probe agent38.kisops.org # 加入新节点

gluster peer status # 查看集群的节点信息

以/data/glusterfs为共享目录,创建一个名为gfs的存储卷,数据复制2份:

gluster volume create gfs replica 2 agent{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38}.kisops.org:/data/glusterfs  # 创建卷

gluster volume start gfs # 启动卷

gluster volume info # 查看卷信息

gluster volume set gfs auth.allow 10.20.* # 授权访问

uid-22166872-id-4194504.html

OK,此时服务端已配置完毕,过程简单明了!客户端就更简单了:

yum -y install glusterfs glusterfs-fuse

mount -t glusterfs agent38.kisops.org:/gfs /mnt/gfs # 挂载任一节点即可(推荐)

mount.nfs agent38.kisops.org:/gfs /mnt/nfs -o nfsvers=3,proto=tcp # 使用NFS挂载,注意远端的rpcbind服务必须开启

mount -t nfs -o rw,nfsvers=3,proto=tcp,port=38465,nolock,noacl,nocto,noatime,nodiratime,rsize=131072,wsize=524288,async,soft,bg,acregmin=3,acregmax=10,acdirmin=1,acdirmax=5 agent21.kisops.org:/gfs /mnt/nfs # 标准挂法

# 若需要开机自动挂载,请更新/etc/fstab,追加:

agent38.kisops.org:/gfs /mnt/gfs glusterfs defaults,_netdev 0 1

uid-22166872-id-4194504.html

GlusterFS分布式存储

一、简介

Glusterfs是一个具有可以扩展到几个PB数量级的集群文件系统。它可以把多个不同类型的存储块通过Infiniband RDMA或者TCP/IP汇聚成一个大的并行网络文件系统。

注:InfiniBand架构是一种支持多并发链接的“转换线缆”技术。InfiniBand技术不是用于一般网络连接的,它的主要设计目的是针对服务器端的连接问题的。因此,InfiniBand技术将会被应用于服务 器与服务器(比如复制,分布式工作等),服务器和存储设备(比如SAN和直接存储附件)以及服务器和网络之间(比如LAN, WANs和the Internet)的通信。

Effective theoretical throughput in different configurations

Single ()

Double ()

Quad ()

1X

2 Gbit/s

4 Gbit/s

8 Gbit/s

4X

8 Gbit/s

16 Gbit/s

32 Gbit/s

12X

24 Gbit/s

48 Gbit/s

96 Gbit/s

二、测试环境介绍

uid-22166872-id-4194504.html

测试服务器共2台:GLUSTERFS1和GLUSTERFS2,安装CentOS5.3。其中GLUSTERFS1扮演CLIENT和SERVER双重角色,GLUSTERFS2只扮演SERVER角色。(注:在GlusterFS中,Server角色主要将服务器中文件夹声明成存储单元,而Client通过配置相应的Translator实现复制、分布式存储的功能。Client亦可是一台单独的服务器)

存储单元:在GLUSTERFS1和GLUSTERFS2中分别声明出BRICK-A和BRICK-B两个存储单元

预期达成效果:希望能实现类似硬盘RAID1+0的效果,就是说先将两台服务器的BRICK-A做一个镜像,然后再此基础上做一个分散式存储,并mount到一个叫glusterfs的文件夹供用户使用。

三、安装部署

1.下载/安装源码

? FUSE(Filesystem in Userspace):

– fuse-2.7.4.tar.gz

? GlusterFS:

– glusterfs-2.0.8.tar.gz

解压后在相应数据夹下执行命令配置、编译及安装FUSE和GlusterFS:

./configure

make

make install

2.建立相关文件夹

在GLUSTER1建立export-a、export-b、glusterfs

#mkdir /data/export-a

#mkdir /data/export-b

#mkdir /mnt/glusterfs

在GLUSTER2建立export-a、export-b

#mkdir /data/export-a

#mkdir /data/export-b

3.分别在两台GLUSTERFS1和GLUSTERFS2完成GlusterFS Server端配置档编写

#vim /etc/glusterfs/glusterfsd.vol

volume posix-a

type storage/posix

option directory /data/export-a

end-volume

volume locks-a

type features/locks

subvolumes posix-a

end-volume

volume brick-a

type performance/io-threads

option thread-count 8

subvolumes locks-a

end-volume

volume posix-b

type storage/posix

option directory /data/export-b

end-volume

volume locks-b

type features/locks

subvolumes posix-b

end-volume

volume brick-b

type performance/io-threads

option thread-count 8

subvolumes locks-b

end-volume

volume server

type protocol/server

option transport-type tcp

option auth.addr.brick-a.allow *

option auth.addr.brick-b.allow *

subvolumes brick-a brick-b

end-volume

4.在GLUSTERFS1完成GlusterFS Client端配置档编写

#vim /etc/glusterfs/glusterfs.vol

volume brick-1a

type protocol/client

option transport-type tcp/client

option remote-host 10.167.10.118 # IP address of the remote brick

option remote-subvolume brick-a # name of the remote volume

end-volume

### Add client feature and attach to remote brick-a subvolume of server2

volume brick-2a

type protocol/client

option transport-type tcp/client

option remote-host 10.167.10.119 # IP address of the remote brick

option remote-subvolume brick-a # name of the remote volume

end-volume

### Add client feature and attach to remote brick-b subvolume of server1

volume brick-1b

type protocol/client

option transport-type tcp/client

option remote-host 10.167.10.118 # IP address of the remote brick

option remote-subvolume brick-b # name of the remote volume

end-volume

### Add client feature and attach to remote brick-b subvolume of server2

volume brick-2b

type protocol/client

option transport-type tcp/client

option remote-host 10.167.10.119 # IP address of the remote brick

option remote-subvolume brick-b # name of the remote volume

end-volume

#The replicated volume with brick-a

volume replication1

type cluster/replicate

subvolumes brick-1a brick-2a

end-volume

#The replicated volume with brick-b

volume replication2

type cluster/replicate

subvolumes brick-1b brick-2b

end-volume

#The distribution of all replication volumes (used for > 2 servers)

volume distribution

type cluster/distribute

option lookup-unhashed yes

subvolumes replication1 replication2

end-volume

5.分别在GLUSTERFS1和GLUSTERFS2中运行GlusterFS Server端

[root@glusterfs1]#glusterfs –f /etc/glusterfs/glusterfsd.vol –l /tmp/glusterfsd.log

[root@glusterfs1]#tail /tmp/glusterfsd.log

[2009-11-16 17:11:04] N [glusterfsd.c:1306:main] glusterfs: Successfully started

[root@glusterfs1]# #netstat –tl

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State

tcp        0      0 *:ideafarm-catch            *:*                         LISTEN

tcp        0      0 *:netbios-ssn               *:*                         LISTEN

tcp        0      0 *:sunrpc                    *:*                         LISTEN

tcp        0      0 *:6996                      *:*                         LISTEN

tcp        0      0 localhost.localdomain:ipp   *:*                         LISTEN

tcp        0      0 localhost.localdomain:smtp *:*                         LISTEN

tcp        0      0 *:microsoft-ds              *:*                         LISTEN

tcp        0      0 *:http                      *:*                         LISTEN

tcp        0      0 *:ssh                       *:*                         LISTEN

tcp        0      0 *:https                     *:*                         LISTEN

成功启动后,系统中出现6996监听端口。

6.在GLUSTERFS1中运行GlusterFS Client端

#glusterfs –f /etc/glusterfs/glusterfs.vol –l /tmp/glusterfs.log /mnt/glusterfs

#df –h

Filesystem            Size Used Avail Use% Mounted on

/dev/sda2             9.5G 3.8G 5.3G 42% /

/dev/sda5              20G 522M   18G   3% /home

/dev/sda1              99M   12M   83M 12% /boot

tmpfs                 506M     0 506M   0% /dev/shm

glusterfs#/etc/glusterfs/glusterfs.vol

19G 7.5G   11G 42% /mnt/glusterfs

成功运行后, 就可以通过/mnt/glusterfs来访问了。

下期预告:针对GlusterFS进行简单的功能测试。

GlusterFS分布式存储(二)Replicate功能测试

一、前言

此次主要针对GlusterFS中的Replicate进行可用性和恢复性测试。

uid-22166872-id-4194504.html

二、测试过程

1.模拟系统故障,关闭GLUSTERFS1上的Glusterfs Server和Glusterfs Client,删除GLUSTERFS1中BRICK-A和BRICK-B中文件。

2.在GLUSTERFS2上启动Glusterfs Client

3.检查文件服务可用性:文件读取及存储操作正常。

4.重新启动GLUSTERFS1并启动Glusterfs Server,检查系统可用性:无法查看目录中文件列表;但可以通过文件完整路径,访问文件。

5.变更replicate中的主副关系,在GLUSTERFS2中修改/etc/glusterfs/glusterfs.vol

#The replicated volume with brick-a

volume replication-a

type cluster/replicate

subvolumes brick-2a brick-1a

end-volume

#The replicated volume with brick-b

volume replication-b

type cluster/replicate

subvolumes brick-2b brick-1b

end-volume

6.重建GLUSTERFS1中数据:启动GLUSTERFS1的Glusterfs Server,系统完成自我修复(ls -lR)。

7.检查系统恢复情况,确认数据完整性:文件恢复成功

三、测试结论

1.可用性测试结论

? 作为访问入口的Glusterfs Client不存在单点失败问题,可在不同服务器中启动。

? 文件存取不存在单点失败的问题:任何一台subvolume失败,都不影响文件的读取和写入。

2.恢复性测试结论

? 用新的subvolume替换损坏的subvolume时

– 当浏览目录的时候,自我修复机制启动,会将当前目录下文件复制到新的subvolume中。

– 如想强制所有目录全部自我修复,需遍历所有目录,例如使用命令 ls –lR

? 当损坏的subvolume为主subvolume:

– 如果某个文件不在主subvolume,但存在于其它的subvolume,通过入口是无法看到此文件的。此时自我修复无法通过浏览目录启动。

– 但是如果已知道此文件名称,还是可以访问此文件并自我修复的。换句话说,在自我修复过程中,系统的读取和写入不受影响。

– 可以架设一台Glusterfs Client专门负责自我修复工作,此台Glusterfs Client会调换subvolume的主从关系

本文环境:一台服务器,一台测试机均为CentOS-5.2操作系统,服务器端的ip为:192.168.10.252,测试机的ip为192.168.10.14 在服务端有一个独立的磁盘用来测试

一 服务器端的安装和配置

1.首先安装fuse扩展

[root@test-1 ~]# tar zvxf fuse-2.8.3.tar.gz

[root@test-1 ~]# cd fuse-2.8.3

[root@test-1 ~]# ./configure --enable-dependency-tracking --enable-lib --enable-util

[root@test-1 ~]# make

[root@test-1 ~]# make install

2.检查fuse是否安装正确,如果不正确后面启动和挂载glusterfs时候都会报错

[root@test-1 ~]# ll /dev/fuse

crw-rw-rw- 1 root root 10, 229 Apr 23 14:08 /dev/fuse

3.安装服务器端

[root@test-1 ~]# cd ..

[root@test-1 ~]# tar zvxf glusterfs-3.0.3.tar.gz

[root@test-1 ~]# cd glusterfs-3.0.3

[root@test-1 ~]# ./configure --enable-fusermount

uid-22166872-id-4194504.html

[root@test-1 ~]# make

[root@test-1 ~]# make install

4.创建本地的共享点同时挂载硬盘分区

[root@test-1 ~]# mkdir /home/gluster

[root@test-1 ~]# mount /dev/sdb1 /home/gluster/

[root@test-1 ~]# chmod 777 /home/gluster/

5.查看挂载是否正常

[root@test-1 ~]# df -lh

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

7.0G 3.4G 3.2G 52% /

/dev/sda1 99M 12M 83M 13% /boot

tmpfs 125M 0 125M 0% /dev/shm

/dev/sdb1 4.0G 8.0M 3.8G 1% /home/gluster

6.开始配置服务器端配置文件,首先先备份示例文件

[root@test-1 ~]#cd /usr/local/etc/glusterfs

[root@test-1 ~]# mkdir bak

[root@test-1 ~]# mv *.sample bak

[root@test-1 ~]# cp bak/glusterfsd.vol.sample glusterfsd.vol

[root@test-1 ~]# echo "" >glusterfsd.vol

[root@test-1 ~]# vi glusterfsd.vol(配置如下)

### Export volume "brick" with the contents of "/home/export" directory.

volume brick

type storage/posix # POSIX FS translator

option directory /home/gluster # Export this directory

end-volume

volume locker

type features/locks

subvolumes brick

end-volume

volume bricks

type performance/io-threads

option thread-count 50 #//开启50个线程

subvolumes locker

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp/server

option listen-port 6996 # Default is 6996

subvolumes locker

option auth.addr.bricks.allow *

option auth.addr.locker.allow *

end-volume

7. 启动服务器端

[root@test-1 glusterfs]# glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

启动的过程中指定了pid文件位置和日志文件位置

8.验证服务启动是否正常,端口监听

[root@test-1 glusterfs]# netstat -nltp |grep 6996 |grep -v grep

tcp 0 0 0.0.0.0:6996 0.0.0.0:* LISTEN 27698/glusterfsd

[root@test-1 glusterfs]#

二 客户端的安装和配置

1.和服务器端同样的安装操作此处不多说了,接下来配置客户端配置文件

[root@localhost glusterfs]#cd /usr/local/etc/glusterfs

[root@localhost glusterfs]# mkdir bak

[root@localhost glusterfs]# mv *.sample bak

[root@localhost glusterfs]# cp bak/glusterfs.vol.sample glusterfs.vol

[root@localhost glusterfs]# echo "" >glusterfs.vol

[root@localhost glusterfs]# vi glusterfs.vol

volume client1

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.252 #//server ip

option remote-port 6996

option remote-subvolume locker

end-volume

volume bricks

type cluster/distribute

subvolumes client1

end-volume

2.开始客户端的挂载,把服务器端对文件系统挂载到本地的/mnt目录

[root@localhost glusterfs]#glusterfs -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

同样指定了pid文件和日志文件

3.看看是否挂载成了本地文件系统

[root@localhost glusterfs]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/hda2 5.7G 2.0G 3.4G 38% /

/dev/hda1 99M 12M 83M 12% /boot

tmpfs 252M 0 252M 0% /dev/shm

glusterfs#/usr/local/etc/glusterfs/glusterfs.vol

7.0G 3.2G 3.4G 49% /mnt

[root@localhost glusterfs]# mount | tail -1

glusterfs#/usr/local/etc/glusterfs/glusterfs.vol on /data type fuse (rw,allow_other,default_permissions,max_read=131072)

[root@localhost glusterfs]#

三 测试部分

1.在服务器的共享点上创建文件和目录

[root@test-1 gluster]# cd /home/gluster/

[root@test-1 gluster]# touch test

[root@test-1 gluster]# mkdir -p qubaoquan

[root@test-1 gluster]# ls

qubaoquan test

[root@test-1 gluster]#

2.在客户记得挂载点上查看

[root@localhost glusterfs]# cd /mnt/

[root@localhost data]# ls

qubaoquan test

Unify模式简介:

多台server目前空余的硬盘空间利用起来。这就是glusterfsUnify模式的功能,多存储空间的聚合。

本文环境:二台服务器,一台测试机均为CentOS-5.2操作系统,

服务器1的ip为:192.168.10.252,共享目录/home/gluterfs和/data3

服务器2的Ip为:192.168.10.253 , 共享目录是/data和/data2

测试机的ip为192.168.10.14 , 挂载点为/mnt

一 服务器1的安装和配置

1.首先安装fuse扩展

[root@test-1 ~]# tar zvxf fuse-2.8.3.tar.gz

[root@test-1 ~]# cd fuse-2.8.3

[root@test-1 ~]# ./configure --enable-dependency-tracking --enable-lib --enable-util

[root@test-1 ~]# make

[root@test-1 ~]# make install

2.检查fuse是否安装正确,如果不正确后面启动和挂载glusterfs时候都会报错

[root@test-1 ~]# ll /dev/fuse

crw-rw-rw- 1 root root 10, 229 Apr 23 14:08 /dev/fuse

3.安装服务器端

[root@test-1 ~]# cd ..

[root@test-1 ~]# tar zvxf glusterfs-2.0.0rc1.tar.gz

[root@test-1 ~]# cd glusterfs-2.0.0rc1

[root@test-1 ~]# ./configure

uid-22166872-id-4194504.html

[root@test-1 ~]# make

[root@test-1 ~]# make install

4.创建本地的共享点1

[root@test-1 ~]# mkdir /data

[root@test-1 ~]# chmod 777 /data

5.创建本地输出目录2

[root@test-1 ~]#touch /data2

[root@test-1 ~]# chmod 777 /data2

6.开始配置服务器端配置文件,首先先备份示例文件

[root@test-1 ~]#cd /usr/local/etc/glusterfs

[root@test-1 ~]# mkdir bak

[root@test-1 ~]# mv *.sample bak

[root@test-1 ~]# vi glusterfsd.vol(配置如下)

volume brick

type storage/posix # POSIX FS translator

option directory /home/gluster # Export this directory

end-volume

volume brick-ns

type storage/posix

option directory /data3

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp/server

subvolumes brick brick-ns

option auth.addr.brick.allow *

option auth.addr.brick-ns.allow *

end-volume

7. 启动服务器端

[root@test-1 glusterfs]# glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

启动的过程中指定了pid文件位置和日志文件位置

8.验证服务启动是否正常,端口监听

[root@test-1 glusterfs]# netstat -nltp |grep 6996 |grep -v grep

tcp 0 0 0.0.0.0:6996 0.0.0.0:* LISTEN 27698/glusterfsd

[root@test-1 glusterfs]#

二 服务器端2的安装和配置

1.首先安装fuse扩展

[root@test-2~]# tar zvxf fuse-2.8.3.tar.gz

[root@test-2~]# cd fuse-2.8.3

[root@test-2~]# ./configure --enable-dependency-tracking --enable-lib --enable-util

[root@test-2~]# make

[root@test-2~]# make install

2.检查fuse是否安装正确,如果不正确后面启动和挂载glusterfs时候都会报错

[root@test-2~]# ll /dev/fuse

crw-rw-rw- 2root root 10, 229 Apr 23 14:08 /dev/fuse

3.安装服务器端

[root@test-2~]# cd ..

[root@test-2~]# tar zvxf glusterfs-2.0.0rc1.tar.gz

[root@test-2~]# cd glusterfs-2.0.0rc1

[root@test-2~]# ./configure

uid-22166872-id-4194504.html

[root@test-2~]# make

[root@test-2~]# make install

4.创建本地的共享点1同时挂载硬盘分区

[root@test-2~]# mkdir /home/gluster

[root@test-2~]# mount /dev/sdb1 /home/gluster/

[root@test-2~]# chmod 777 /home/gluster/

5.创建本地输出目录2

[root@test-2~]#touch /data3

[root@test-2~]# chmod 777 /data3

6.查看挂载是否正常

[root@test-2~]# df -lh

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

7.0G 3.4G 3.2G 52% /

/dev/sda1 99M 12M 83M 13% /boot

tmpfs 125M 0 125M 0% /dev/shm

/dev/sdb1 4.0G 8.0M 3.8G 1% /home/gluster

7.开始配置服务器端配置文件,首先先备份示例文件

[root@test-2~]#cd /usr/local/etc/glusterfs

[root@test-2~]# mkdir bak

[root@test-2~]# mv *.sample bak

[root@test-2~]# vi glusterfsd.vol(配置如下)

volume brick

type storage/posix # POSIX FS translator

option directory /data # Export this directory

end-volume

volume brick-ns

type storage/posix

option directory /data2

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp/server

subvolumes brick brick-ns

option auth.addr.brick.allow *

option auth.addr.brick-ns.allow *

end-volume

8. 启动服务器端

[root@test-2glusterfs]# glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

启动的过程中指定了pid文件位置和日志文件位置

9.验证服务启动是否正常,端口监听

[root@test-2glusterfs]# netstat -nltp |grep 6996 |grep -v grep

tcp 0 0 0.0.0.0:6996 0.0.0.0:* LISTEN 27698/glusterfsd

[root@test-2glusterfs]#

三 客户端的安装和配置

1.和服务器端同样的安装操作此处不多说了,接下来配置客户端配置文件

[root@localhost glusterfs]#cd /usr/local/etc/glusterfs

[root@localhost glusterfs]# mkdir bak

[root@localhost glusterfs]# mv *.sample bak

[root@localhost glusterfs]# vi glusterfs.vol

volume client1

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.252 #//server ip

option remote-port 6996

option remote-subvolume brick

end-volume

volume client2

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.253 #//server ip

option remote-port 6996

option remote-subvolume brick

end-volume

volume client1-ns

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.252

option remote-subvolume brick-ns

end-volume

volume unify

type cluster/unify

subvolumes client1 client2

option namespace client1-ns

option scheduler rr

end-volume

2.开始客户端的挂载,把服务器端对文件系统挂载到本地的/mnt目录

[root@localhost glusterfs]#glusterfs -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

同样指定了pid文件和日志文件

3.看看是否挂载成了本地文件系统

[root@localhost glusterfs]# df –h

Filesystem Size Used Avail Use% Mounted on

/dev/hda2 5.7G 2.1G 3.4G 39% /

/dev/hda1 99M 12M 83M 12% /boot

tmpfs 252M 0 252M 0% /dev/shm

glusterfs 11G 3.2G 7.2G 31% /mnt

[root@localhost glusterfs]# mount | tail -1

glusterfs#/usr/local/etc/glusterfs/glusterfs.vol on /data type fuse (rw,allow_other,default_permissions,max_read=131072)

[root@localhost glusterfs]#

三 测试部分

1.在服务器1的共享点上创建文件

[root@test-1 ~]# cd /data3

[root@test-1 data3]# touch data3

[root@test-1 data3]# cd /home/gluster/

[root@test-1 gluster]# touch gluster

[root@test-1 gluster]#

2.在服务器2的共享点上创建文件

[root@test-2 data]# cd /data

[root@test-2 data]# touch data

[root@test-2 data]# cd /data2

[root@test-2 data2]# touch data2

3.在客户记得挂载点上查看

[root@localhost mnt]# ls

data data3 gluster data2

[root@localhost mnt]#

Replacte模式简介:

为提供了类似RAID-1的功能。Replicate会复制文件或者文件夹到各个subvolumes里。因此,如果replicate部分设置了4个subvolume,那就会4分的文件或者文件夹的拷贝副本。replicate同样提供了高可用,比如如果其中的一个subvolume down掉了(或者说一台存储服务器坏了,网络连接出现问题)replicate依然可以使用冗余的拷贝副本来提供服务。

Replicate同样提供了自动修复功能,比如,如果一台crash掉的服务器恢复了,这台服务器上存储的过期的文件或者文件夹就会被更新成最新的版本。Replicate使用了后端文件系统的扩展功能来跟踪文件或者文件夹的版本来提供自动恢复的功能

本文环境:二台服务器,一台测试机均为CentOS-5.2操作系统,

服务器1的ip为:192.168.10.252,共享目录/home/gluterfs

服务器2的Ip为:192.168.10.253 , 共享目录是/data

测试机的ip为192.168.10.14 , 挂载点为/mnt

一 服务器1的安装和配置

1.首先安装fuse扩展

[root@test-1 ~]# tar zvxf fuse-2.8.3.tar.gz

[root@test-1 ~]# cd fuse-2.8.3

[root@test-1 ~]# ./configure --enable-dependency-tracking --enable-lib --enable-util

[root@test-1 ~]# make

[root@test-1 ~]# make install

2.检查fuse是否安装正确,如果不正确后面启动和挂载glusterfs时候都会报错

[root@test-1 ~]# ll /dev/fuse

crw-rw-rw- 1 root root 10, 229 Apr 23 14:08 /dev/fuse

3.安装服务器端

[root@test-1 ~]# cd ..

[root@test-1 ~]# tar zvxf glusterfs-2.0.0rc1.tar.gz

[root@test-1 ~]# cd glusterfs-2.0.0rc1

[root@test-1 ~]# ./configure

uid-22166872-id-4194504.html

[root@test-1 ~]# make

[root@test-1 ~]# make install

4.创建本地的共享点1

[root@test-1 ~]# mkdir /data

[root@test-1 ~]# chmod 777 /data

5.开始配置服务器端配置文件,首先先备份示例文件

[root@test-1 ~]#cd /usr/local/etc/glusterfs

[root@test-1 ~]# mkdir bak

[root@test-1 ~]# mv *.sample bak

[root@test-1 ~]# vi glusterfsd.vol(配置如下)

volume brick

type storage/posix # POSIX FS translator

option directory /data

end-volume

volume locker

type features/posix-locks

subvolumes brick

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp/server

subvolumes locker

option auth.addr.brick.allow * # Allow access to "brick" volume

option auth.addr.locker.allow *

end-volume

6. 启动服务器端

[root@test-1 glusterfs]# glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

启动的过程中指定了pid文件位置和日志文件位置

7.验证服务启动是否正常,端口监听

[root@test-1 glusterfs]# netstat -nltp |grep 6996 |grep -v grep

tcp 0 0 0.0.0.0:6996 0.0.0.0:* LISTEN 27698/glusterfsd

[root@test-1 glusterfs]#

二 服务器端2的安装和配置

1.首先安装fuse扩展

[root@test-2~]# tar zvxf fuse-2.8.3.tar.gz

[root@test-2~]# cd fuse-2.8.3

[root@test-2~]# ./configure --enable-dependency-tracking --enable-lib --enable-util

[root@test-2~]# make

[root@test-2~]# make install

2.检查fuse是否安装正确,如果不正确后面启动和挂载glusterfs时候都会报错

[root@test-2~]# ll /dev/fuse

crw-rw-rw- 2root root 10, 229 Apr 23 14:08 /dev/fuse

3.安装服务器端

[root@test-2~]# cd ..

[root@test-2~]# tar zvxf glusterfs-2.0.0rc1.tar.gz

[root@test-2~]# cd glusterfs-2.0.0rc1

[root@test-2~]# ./configure

uid-22166872-id-4194504.html

[root@test-2~]# make

[root@test-2~]# make install

4.创建本地的共享点1同时挂载硬盘分区

[root@test-2~]# mkdir /home/gluster

[root@test-2~]# mount /dev/sdb1 /home/gluster/

[root@test-2~]# chmod 777 /home/gluster/

5.查看挂载是否正常

[root@test-2~]# df -lh

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

7.0G 3.4G 3.2G 52% /

/dev/sda1 99M 12M 83M 13% /boot

tmpfs 125M 0 125M 0% /dev/shm

/dev/sdb1 4.0G 8.0M 3.8G 1% /home/gluster

6.开始配置服务器端配置文件,首先先备份示例文件

[root@test-2~]#cd /usr/local/etc/glusterfs

[root@test-2~]# mkdir bak

[root@test-2~]# mv *.sample bak

[root@test-2~]# vi glusterfsd.vol(配置如下)

volume brick

type storage/posix # POSIX FS translator

option directory /home/gluster

end-volume

volume locker

type features/posix-locks

subvolumes brick

end-volume

### Add network serving capability to above brick.

volume server

type protocol/server

option transport-type tcp/server

subvolumes locker

option auth.addr.brick.allow * # Allow access to "brick" volume

option auth.addr.locker.allow *

end-volume

7. 启动服务器端

[root@test-2glusterfs]# glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

启动的过程中指定了pid文件位置和日志文件位置

8.验证服务启动是否正常,端口监听

[root@test-2glusterfs]# netstat -nltp |grep 6996 |grep -v grep

tcp 0 0 0.0.0.0:6996 0.0.0.0:* LISTEN 27698/glusterfsd

[root@test-2glusterfs]#

三 客户端的安装和配置

1.和服务器端同样的安装操作此处不多说了,接下来配置客户端配置文件

[root@localhost glusterfs]#cd /usr/local/etc/glusterfs

[root@localhost glusterfs]# mkdir bak

[root@localhost glusterfs]# mv *.sample bak

[root@localhost glusterfs]# vi glusterfs.vol

volume client1

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.252 #//server ip

option remote-port 6996

option remote-subvolume locker

end-volume

volume client2

type protocol/client

option transport-type tcp/client

option remote-host 192.168.10.253 #//server ip

option remote-port 6996

option remote-subvolume locker

end-volume

volume bricks

type cluster/replicate

subvolumes client1 client2

end-volume

2.首先挂载fuse模块

[root@localhost glusterfs]#modprobe fuse

3.开始客户端的挂载,把服务器端对文件系统挂载到本地的/mnt目录

[root@localhost glusterfs]#glusterfs -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/glusterfs.pid

同样指定了pid文件和日志文件

4.看看是否挂载成了本地文件系统

[root@localhost glusterfs]# df –h

Filesystem Size Used Avail Use% Mounted on

/dev/hda2 5.7G 2.1G 3.4G 39% /

/dev/hda1 99M 12M 83M 12% /boot

tmpfs 252M 0 252M 0% /dev/shm

glusterfs 11G 3.2G 7.2G 31% /mnt

[root@localhost glusterfs]# mount | tail -1

glusterfs#/usr/local/etc/glusterfs/glusterfs.vol on /data type fuse (rw,allow_other,default_permissions,max_read=131072)

[root@localhost glusterfs]#

三 测试部分

1.在客户端的挂在点上创建文件

[root@localhost mnt]# cd /mnt

[root@localhost mnt]# touch test

2.然后再两个服务器端查看,可以看到2个服务器同时产生了副本

[root@test-1 gluster]# cd /home/gluster/(服务器-1)

[root@test-1 gluster]# ls

test

[root@test-2 data]# cd /data(服务器-2)

[root@test-2 data]# ls

test

3.挂掉服务器端1,然手再续在客户端创建新文件

[root@test-1 gluster]# kill -9 `cat /var/run/glusterfs.pid`(服务器-1)

[root@localhost mnt]# touch test2

[root@localhost mnt]# ls

test test2

[root@localhost mnt]#

4.然后分别查看两个服务器端的数据变换

[root@test-1 gluster]# cd /home/gluster/(服务器-1)

[root@test-1 gluster]# ls

test

[root@test-2 data]# cd /data(服务器-2)

[root@test-2 data]# ls

test test2

5.现在启动服务器-1,然后查看数据是否同步过来

[root@test-1 gluster]#glusterfsd -l /var/log/glusterfs.log -f /usr/local/etc/glusterfs/glusterfsd.vol -p /var/run/gluterfs.pid

[root@test-1 gluster]# cd /home/gluster/(服务器-1)

[root@test-1 gluster]# ls

test(暂时无变化)

6.现在在客户端重新查询一下数据,以把请求复制到服务器-1上,这样两个服务器的内容就一致了

[root@localhost mnt]# cd /mnt

[root@localhost mnt]# ls

test test2

7.到服务器-1上看test2文件是否已经复制过来了

[root@test-1 gluster]# cd /home/gluster/(服务器-1)

[root@test-1 gluster]# ls

test test2(已经复制成功)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

文件服务器fuse,分布式文件系统glusterfs安装步骤 的相关文章

  • ELK-日志服务【redis-配置使用】

    目录 环境 1 redis配置 2 filebeat配置 3 对接logstash配置 4 验证 5 安全配置 第一种 kibana nginx访问控制 6 第二种 在ES 主节点 配置TLS 7 kibana配置密码 8 logstash
  • 晨光文具去年赚5亿,连2000元都拿来理财

    只要走出学校大门 在不多于500米半径范围内 你都能轻松找到晨光文具的门店 大到一线城市 小到三四线县城 经过20年苦心经营 晨光文具已经做到了这种格局 在这种格局背后 是晨光系7 2万家零售终端的缜密布局 20年来 在国内书写工具以及学生
  • 07:和为给定数

    总时间限制 1000ms 内存限制 65536kB 描述 给出若干个整数 询问其中是否有一对数的和等于给定的数 输入 共三行 第一行是整数n 0 lt n lt 100 000 表示有n个整数 第二行是n个整数 整数的范围是在0到10 8之
  • Linux Suse firewall 查看,关闭,启动

    查看 linux chkconfig list grep i fire 关闭 linux SuSEfirewall2 stop 启动 linux SuSEfirewall2 stop
  • 最小生成树以及Kruskal算法,Prime算法

    一 最小生成树 连通图 在无向图中 若从顶点v1到顶点v2有路径 则称顶点v1与顶点v2是连通的 如果图中任 意一对顶点都是连通的 则称此图为连通图 强连通图 在有向图中 若在每一对顶点vi和vj之间都存在一条从vi到vj的路径 也存在一条
  • 信号处理中简单实用的方法——提取信号中的包络

    一 用希尔伯特变换计算信号的包络 在求某一信号包络时用得最多的是希尔伯特变换 但并不是希尔伯特变换适用于所有信号求包络的情况 这是因为对于包络没有一个很严格的定义 在求包络时不同的情况会有不同的要求 下面将介绍用希尔伯特变换求取信号的包络
  • JVM一个类的加载过程

    七大步骤 具体过程 加载 classpath jar包 网络 某个磁盘位置下的类的class二进制字节流读进来 在内存中生成一个代表这个类的 java lang Class 对象放入元空间 此阶段我们的程序员可以干预 我们可以自定义类加载器
  • java web考试题及答案_2016JAVA-WEB期末复习题库附答案.doc

    1 当访问一个Servlet时 以下Servlet中的哪个方法先被执行 D A destroy B doGet C service D init0 2 假设在myServlet应用中有一个MyServlet类 在web xml文件中对其进行
  • 【leetcode】求两个链表的交点

    求两个链表的交点 c 借助set Definition for singly linked list struct ListNode int val ListNode next ListNode int x val x next NULL
  • 静态时序分析-Multicycle约束

    有时 前端在一些关键路径上的设计 可能会出现两个时钟周期驱动和采样一拍数据 来放松关键路径上的时序 这样的设计在STA约束过程中 如果不放松 会导致Timing违例过大 无法收敛 此时的Timing由前端逻辑实现保证 STA约束即可释放 以
  • 关于VScode引用头文件时一直报错的解决方法

    一 首先看下配置文件 常见的错误原因可能是因为 c cpp properties json 这个文件并没有配置好 可以参考下列的文件 在这里插入代 configurations name Win32 includePath workspac
  • iOS开发之数据存取(三)——FMDB

    FMDB 基本使用 相比于SQLite3来说Core Data存在着诸多优势 它面向对象 开发人员不必过多的关心更多数据库操作知识 同时它基于ObjC操作 书写更加优雅等 但是它本身也存在着一定的限制 例如如果考虑到跨平台 则只能选择SQL
  • AT24C02芯片介绍

    AT24C02管脚介绍 AT24C02低功耗CMOS串行EEPROM 它是内含256 8位存储空间 具有工作电压宽 2 5 5 5V 擦写次数多 大于10000次 写入速度快 小于10ms 等特点 AT24C02的1 2 3脚是三条地址线
  • 如何使用idea来查找所有未使用的代码?

    一 目的 通过idea快速找到项目中没有被使用的代码 二 操作步骤 2 1 Code gt Analyze Code gt Run Inspection by Name 2 2 输入Unused declaration gt 查询没有被使用
  • HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException type

    个人错误记录 本人目前水平不够 所以不喜勿喷 谢谢 我的错误原因 在SSM中 使用set注入的方式注入对象导致 源码 lt Controller RequestMapping role public class RoleController
  • write和fwrite

    如果只是普通地以O RDWR的flag去open一个文件朝里write 不考虑创建 扩增 那默认内核会把文件的这个页面读进来缓存在内核里的 也即所谓的page cache 随后再发起新的write syscall写相同的页面时 只要写在pa
  • vue3中将表格导出成excel文件

    yarn add xlsx yarn add file saver 通过调用exportData方法 excel 文件 传递数据和文件名 function exportToExcel tableData filename 1 JSON 数据
  • 【FPGA】SPI协议

    1 SPI简介 SPI Serial Perripheral Interface 串行外围设备接口 是 Motorola 公司推出的一种同步串行接口技术 SPI 总线在物理上是通过接在外围设备微控制器 PICmicro 上面的微处理控制单元

随机推荐

  • 掌优电子为商家提供合理的移动支付解决方案

    目前官方正式对外的是微信的青蛙 和支付宝的蜻蜓 而市面上众多的刷脸支付设备 更多的是作为系统商联系对应的厂商进行生产 并非官方授权 其背后的安全性是值得考究的 从客观角度去讲的话 官方的设备 就算贵 但正规 安全 且用的放心 刷脸支付的问世
  • vue项目中实现文字滚动(跑马灯)效果——公告滚动播放

    项目需求 系统公告 要从右忘左循环播放的牛皮广告效果 实现 方案一 使用定时器和CSS3的过渡属性来实现
  • gitea无法连接mysql_Git push ERROR: Repository not found fatal:无法连接远程数据库

    用linux Debian git 上传到github 遇到的问题以及解决方案 git init git add bubble go git add bubble test go git commit m git remote add or
  • Python自学心得分享

    学习python 我首先根据自己完全代码零基础的情况下 为什么学习Python作为核心问题 进行了一个自我定位以及目标定位 我认为只要有一个目标 那么就找方法去打成目标就行了 我是完全零基础 选择学习Python主要还是因为看到大家都说Py
  • Struts2 validation.xml 正则表达式不起作用

  • Python操作Excel教程(图文教程,超详细)Python xlwings模块详解,

    作者主页 士别三日wyx 作者简介 CSDN top100 阿里云博客专家 华为云享专家 网络安全领域优质创作者 推荐专栏 小白零基础 Python入门到精通 xlwings模块详解 1 快速入门 1 打开Excel 2 创建工作簿 2 1
  • MyBatis如何实现多表联查

    一 通过映射配置文件实现多表联查 首先 使用Mysql数据库 创建两个表 分别为学生表Student表和班级表Class表 在Student表中添加列classid参照主表的列id的外键约束 学生表Student表 班级表Class表 现在
  • (三)工作流Activiti7-个人任务查询及完成

    前言 在 上篇文章中我们已经完成了流程的定义和部署 通过repositoryService部署并启动流程后就已经开始给每个负责人分配任务了 比如下图 assignee可以写死但一般都是通过变量来设置任务负责人的 在启动一个流程实例的时候就可
  • linux命令之chmod

    chmod 英文全拼 change mode 命令是控制用户对文件的权限的命令 常见报错提醒 Permission denied 解决方法 chmod 777 lady sh 原理详解 首先 查看文件权限 命令 ls l 若想设置文件权限
  • idea整合git解决代码冲突(图文通俗易懂)

    idea整合git的步骤如下 1 快速搭建一个web工程 2 在idea对git进行相关配置 自行下载安装git 配置git exe的路径 自行注册github账号 添加github账号到idea 3 对项目新建一个本地仓库 新建仓库后 找
  • FTP连接时出现“227 Entering Passive Mode” 的解决方法

    今天从公网的服务器连接本地内网的FTP server copy文件时 系统老是提示227 Entering Passive Mode xxx xxx xxx xxx x 很是奇怪 于是上网找资料仔细研究了一下 原来FTP有两种工作模式 PO
  • Python从入门到放弃 (一) Python3的安装 以及pip安装

    编程语言只是一个工具 能够让这个工具具有什么样的效果取决于使用这个工具的人 笔者根据自己的经验写了一下Python3的学习 让新手小白快速入门 不足之处请读者指正 一 Python入门学习介绍 任何一门编程语言都需要开发环境 有了开发环境才
  • IP地址大全之IPV4版

    首先给大家分享一个巨牛巨牛的人工智能教程 是我无意中发现的 教程不仅零基础 通俗易懂 而且非常风趣幽默 还时不时有内涵段子 像看小说一样 哈哈 我正在学习中 觉得太牛了 所以分享给大家 点这里可以跳转到教程 IP 地 址 我们平时说的IP地
  • 响应式开发一招致胜 学习视频 分享

    转载于 https www cnblogs com ios9 p 8526562 html
  • VS远程调试与附加调试

    一 发送文件到目标机器 我的程序是x64 所以拷贝这个文件夹到目标机器即可 二 配置目标机器为远程调试状态 zheg 1 双击msvsmon exe 2 配置无需密码直接可以远程 工具 gt 选项 gt 选择无身份验证 允许任何用户进行调试
  • Python numpy函数:shape用法

    shape函数是numpy core fromnumeric中的函数 它的功能是读取矩阵的长度 比如shape 0 就是读取矩阵第一维度的长度 shape的输入参数可以是一个整数 表示维度 也可以是一个矩阵 以下例子可能会好理解一些 1 参
  • Python对比两个文件夹的文件差异并导出差异

    python脚本 coding utf 8 目录对比工具 包含子目录 并列出 1 A比B多了哪些文件 2 B比A多了哪些文件 3 二者相同的文件 md5比较 import os import time import difflib impo
  • vue使用axios发送post请求携带json body参数,后端使用@RequestBody进行接收

    前言 最近在做自己项目中 做一个非常简单的新增用户场景 但是使用原生axios发送post请求的时候 还是踩了不少坑的 唉 说多了都是泪 小小一个新增业务 在自己前后端一起开发的时候 硬是搞了好久 下面就把问题总结分享下 防止后人再踩坑 接
  • Python3---numpy的详细解读,小白疯狂收藏

    前言 近日梳理python3 的numpy的相关知识点 故自我整理成笔记发布 一是供大家评论和建议 查缺补漏自我知识框架 二是可以进一步熟悉知识 达到更好的融汇贯通的情况 希望看到的兄弟姐妹可以不吝赐教 感激不尽 1 维度 一维数组 二维数
  • 文件服务器fuse,分布式文件系统glusterfs安装步骤

    我的系统是 RHEL5 可能环境不一样 需要安装的第三方依赖不一样啊 反正大家在安装的过程中缺少什么就去安装什么 一般都会有提示的 下载 glusterfs 3 2 0 tar gz 源码包 随便解压到一个目录 glusterfs 需要 f