---
title: "搭建weed-fs"
author: "Josh_Persistence"
date: "2014-05-09T00:07:00Z"
tags: []
categories: ["行业应用"]
slug: "weed-fs"
draft: false
lastmod: "2014-05-09T00:06:59Z"
id: 2063486
url: "https://josh-persistence.iteye.com/blog/2063486"
---

一、主机是一台win7的机器，在win7的机器上使用Virtualbox创建3个虚拟机。3台虚拟机的相关信息分别为

Root Password: swang6

User: josh/josh

Su: root password is swang6

 

Root password: swang6

User:josh/josh

Su: root password is swang6

 

Root password: swang6

User:josh/josh

Su: root password is swang6

 

二、下载weed-fs： [https://code.google.com/p/weed-fs/downloads/list](https://code.google.com/p/weed-fs/downloads/list)

下载Linux版本的tar.gz并分别上传到上面的3个节点中：

1） 如果不能从Windows机器上ping通如上的3台Linux机器，在VirtualBox中可通过右键点击机器名，选择网络，设置桥接网卡即可。

2）将下载的tar.gz从windows目录中拷贝到远程的3台linux机器中：

$ scp weed\_0.45\_linux\_amd64.tar.gz josh@192.168.1.225:/home/software

如果出现如下的错误：  
ssh: connect to host 192.168.1.225 port 22: Bad file number  
lost connection

有可能是sshd服务没有打开，防火墙没有关闭：

```
 1) service sshd status : if inactive, then start
 the sshd service
 2) service sshd start: Active sshd
 4) using ifconfig to see the inet information
 3) service iptables stop: similiar to stop the 
    firewall
```

 如果出现对/home/software的permission 的Access Denied的问题，则可以先临时存储到/tmp中，/tmp是任何用户都有权限写的，即：

scp weed\_0.45\_linux\_amd64.tar.gz josh@192.168.1.225:/tmp

      3）解压该tar.gz:使用命令：tar –xvzf file name 解压。X表示解压，v表示向用户显示信息，z表示是经过解压的。

 

 三、如果在ssh或者是在volume server上使用： weed volume -dir="/tmp/data1"-max=5  -mserver="{masterIp}:9333"-port=8080

时出现 no route host,则需要执行service sshd start和service iptables stop.