企业私有云盘部署文档
Seafile是新一代的企业云存储产品。Seafile的集群方案能满足企业在高并发,大数据量,高可用性,高可靠性方面的要求。Seafile集群采用三层的架构设计,包括:1.负载均衡层:负载均衡器负责接收用户的请求和数据,并分发给集群中的Seafile服务器;2.Seafile服务器集群:由多个独立的Seafile服务器组成。负载均衡器自动检测Seafile服务器的可用性,如果一个Seafile服务
·
使用seafile开源软件实现
Seafile是新一代的企业云存储产品。Seafile的集群方案能满足企业在高并发,大数据量,高可用性,高可靠性方面的要求。
Seafile集群采用三层的架构设计,包括:
1. 负载均衡层:负载均衡器负责接收用户的请求和数据,并分发给集群中的Seafile服务器;
2. Seafile服务器集群:由多个独立的Seafile服务器组成。负载均衡器自动检测Seafile服务器的可用性,如果一个Seafile服务器宕机,负载均衡器会停止向它转发数据,由此保证服务的高可用性。
3. 后端云存储集群:可支持 Amazon S3, OpenStack Swift以及Ceph这几种基于对象的云存储。这保证了存储的可靠性和可扩展性。
先上图看软件实现的效果吧
闲话不多说上“菜”
系统环境
cat /etc/redhat-release
CentOS release 6.7 (Final)
uname -r
2.6.32-573.el6.x86_64
python 环境部署
yum或者使用*.tar.gz包进行安装(不需要多解释)
yum -y install zlib* openssl openssl-devel python-devel 安装python2.7.10 #--enable-shared这个选项是centos6.X需要,如果系统是centos7.X不需要这个选项 tar xf Python-2.7.10.tgz cd Python-2.7.10 ./configure --enable-shared --prefix=/usr/local/python make && make install echo 'PATH=$PATH:/usr/local/python/bin' >>/etc/profile 检查环境变量是否配置成功 tail -1 /etc/profile ln -s /usr/local/python/bin/python /usr/bin/python ln -s /usr/local/python/lib/libpython2.7.so.1.0 /usr/lib/ ln -s /usr/local/python/lib/libpython2.7.so.1.0 /usr/lib64/ source /etc/profile python -V Python 2.7.10 yum不兼容python2.7+所以要修改一下yum的配置文件 vim /usr/bin/yum #把头文件#!/usr/bin/ypthon改成#!/usr/bin/python2.6.6 #再次使用yum就不会报找不到命令的错误了 #如果升级python 安装完成2.7.10后使用以下方式。 ln -s /usr/local/python/bin/python /usr/bin/python
得到以上信息说明py升级成功!python -V Python 2.7.10
安装setuptools
unzip setuptools-32.3.1.zip cd setuptools-32.3.1 python setup.py build python setup.py install
安装pip
tar xf pip-9.0.1.tar.gz cd pip-9.0.1 python setup.py build python setup.py install
安装pillow
pip install pillow
安装Mysql-python
是centos6.X需要手动安装1.2.5,yum安装的是1.2.3版本低,如果系统是centos7.X不需要手动安装 unzip MySQL-python-1.2.5.zip cd MySQL-python-1.2.5 python setup.py build python setup.py install
以上Pyhton环境配置完成让后安装官方文档安装即可
#在官网下载得到的软件链接 yum -y install python-imaging python-ldap python-memcached python-urllib3 tar -zxf seafile-server_6.0.5_x86-64.tar.gz cd seafile-server cd seafile-server-6.0.5/ ll ./setup-seafile-mysql.sh Checking python on this machine ... Checking python module: setuptools ... Done. Checking python module: python-imaging ... Done. Checking python module: python-mysqldb ... Done. ----------------------------------------------------------------- This script will guide you to setup your seafile server using MySQL. Make sure you have read seafile server manual at https://github.com/haiwen/seafile/wiki Press ENTER to continue ----------------------------------------------------------------- What is the name of the server? It will be displayed on the client. 3 - 15 letters or digits [ server name ] wlkj #根据需求起名字 What is the ip or domain of the server? For example: www.mycompany.com, 192.168.1.101 [ This server's ip or domain ] 172.16.10.201 #服务器IP地址 Where do you want to put your seafile data? Please use a volume with enough free space [ default "/server/tools/seafile-data" ] /data/ Which port do you want to use for the seafile fileserver? [ default "8082" ] #数据传输默认端口 ------------------------------------------------------- Please choose a way to initialize seafile databases: ------------------------------------------------------- [1] Create new ccnet/seafile/seahub databases #创造新的ccnet/seafile/seahub数据库 [2] Use existing ccnet/seafile/seahub databases #利用现有ccnet/seafile/seahub数据库 [ 1 or 2 ] 2 What is the host of mysql server? [ default "localhost" ] 172.16.10.101 #数据库IP地址(数据库跟seafile服务器单独存放,如果在本地使用localhost连接) From which hosts could the mysql account be used? [ default "%" ] What is the port of mysql server? [ default "3306" ] #数据库默认端口 Which mysql user to use for seafile? [ mysql user for seafile ] seafile #数据库用户名 What is the password for mysql user "seafile"? [ password for seafile ] #数据库密码 verifying password of user seafile ... done Enter the existing database name for ccnet: [ ccnet database ] seafile #数据库名 verifying user "seafile" access to database seafile ... done Enter the existing database name for seafile: [ seafile database ] [ seahub database ] seafile verifying user "seafile" access to database seafile ... done --------------------------------- This is your configuration --------------------------------- server name: wlkj server ip/domain: 172.16.10.201 seafile data dir: /data/ fileserver port: 8082 database: use existing ccnet database: seafile seafile database: seafile seahub database: seafile database user: seafile --------------------------------- Press ENTER to continue, or Ctrl-C to abort --------------------------------- --------------------------------- Press ENTER to continue, or Ctrl-C to abort --------------------------------- Generating ccnet configuration ... done Successly create configuration dir /server/tools/ccnet. Generating seafile configuration ... Done. done Generating seahub configuration ... ---------------------------------------- Now creating seahub database tables ... ---------------------------------------- creating seafile-server-latest symbolic link ... done ----------------------------------------------------------------- Your seafile server configuration has been finished successfully. ----------------------------------------------------------------- run seafile server: ./seafile.sh { start | stop | restart } #启动方式 run seahub server: ./seahub.sh { start <port> | stop | restart <port> } #关闭方式 ----------------------------------------------------------------- If you are behind a firewall, remember to allow input/output of these tcp ports: ----------------------------------------------------------------- port of seafile fileserver: 8082 port of seahub: 8000 When problems occur, Refer to https://github.com/haiwen/seafile/wiki for information.
==========================================================================================================================================
#进入seafile解压目录启动seafile服务 cd /server/tools/seafile-server-6.0.5/ ./seafile.sh start #默认端口号是8000,可以手动指定端口号 ./seahub.sh start #配置nginx(我是用的nginx做web服务,根据个人喜好)编辑nginx配置文件(nginx扩展配置文件)复制以下内容: server { listen 80; server_name cloud.fairvo.com; proxy_set_headerX-Forwarded-For $remote_addr; location / { fastcgi_pass cloud.fairvo.com:8000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param REMOTE_ADDR $remote_addr; access_log /app/logs/nginx/seahub.access.log; error_log /app/logs/nginx/seahub.error.log; } location /seafhttp { rewrite ^/seafhttp(.*)$ $1break; proxy_passhttp://cloud.fairvo.com:8082; client_max_body_size 0; proxy_connect_timeout 36000s; proxy_read_timeout 36000s; } location /media { root/server/tools/seafile-server-latest/seahub; } } #进入网站后台 系统设置修改 SERVICE_URL =http://自己的地址 FILE_SERVER_ROOT = 'http://自己的地址/seafhttp' #查看端口显示如下内容 netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 14768/python2.7 tcp 0 0 0.0.0.0:82 0.0.0.0:* LISTEN 14654/nginx tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 14523/seaf-server tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1985/sshd tcp 0 0 :::22 :::* LISTEN 1985/sshd
更多推荐
已为社区贡献1条内容
所有评论(0)