swift(Object Storage对象存储服务)(单节点)
# 在部署对象存储服务(swift)之前,你的环境必须包含身份验证服务(keystone);
# keystone需要MySQL数据库,Rabbitmq服务,Memcached服务;
# 内存:4G
# 系统:Ubuntu Server-14.04.5
# 安装方法:http://www.jianshu.com/p/9e77b3ad930a
# IP地址:192.168.10.55
# 主机名:object
基本环境配置
配置主机静态IP地址
vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
# 将dhcp修改为static
iface eth0 inet static
# 静态IP地址
address 192.168.10.55
# 子网掩码
netmask 255.255.255.0
# 广播地址
broadcast 192.168.10.255
# 默认网关
gateway 192.168.10.2
# DNS服务器
## 谷歌DNS
dns-nameservers 8.8.8.8
## 阿里DNS
dns-nameservers 223.5.5.5
重启网卡
# 关闭网卡
ifdown eth0
# 开启网卡
ifup eth0
配置主机名
vim /etc/hostname
# 对于不同的节点,请做出相应的修改
# 清空文件内容
# 主机名
object
配置主机名解析
vim /etc/hosts
# 文件内容,请视实际情况做相应的修改
192.168.10.55 object
验证操作
ping -c 4 主机名
# 例如
ping -c 4 object
配置Ubuntu更新源
vim /etc/apt/sources.list
# 请先把文件内容清空
# 任选一组源
# 中国科学技术大学源
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
# 阿里云的Ubuntu-14.04源
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
更新系统
apt-get update && apt-get dist-upgrade
添加OpenStack库
apt-get install software-properties-common
# 此处命令行会停顿,请按Enter键继续
add-apt-repository cloud-archive:mitaka
安装OpenStack客户端
apt-get install python-openstackclient
更新系统
# 此处为必需步骤
apt-get update && apt-get dist-upgrade
重启主机
shutdown -r now
# 重启电脑后,XShell要用新的IP地址连接虚拟机
# XShell的使用方法:http://www.jianshu.com/p/ada93cba0acd
MySQL服务
安装软件包
# 此处会提示用户设置数据库密码
apt-get install mariadb-server python-pymysql
配置openstack.cnf
vim /etc/mysql/conf.d/openstack.cnf
[mysqld]
# object节点的IP
bind-address = 192.168.10.55
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
重启mysql服务
service mysql restart
mysql安全初始化
# 提示输入密码,问题推荐输入n、y、y、y、y
mysql_secure_installation
Rabbitmq服务
安装软件包
apt-get install rabbitmq-server
添加OpenStack用户
# 此处密码为0901
rabbitmqctl add_user openstack 0901
为OpenStack用户添加读、写及访问权限
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Memcached服务
安装软件包
apt-get install memcached python-memcache
配置memcached.conf
vim /etc/memcached.conf
# object的IP地址
-l 192.168.10.55
重启服务
service memcached restart
keystone的安装
进入数据库
# 提示输入数据库密码
mysql -u root -p
创建keystone数据库
CREATE DATABASE keystone;
赋予keystone相关权限
# 根据实际情况修改密码
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '0901';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY '0901';
退出数据库
exit
生成随机值作为临时令牌(token)
# token:0c7030a400cf77890c75
# token值要与后文统一
openssl rand -hex 10
禁用keystone在安装完成后自启
echo "manual" > /etc/init/keystone.override
安装软件包
apt-get install keystone apache2 libapache2-mod-wsgi
配置keystone.conf
vim /etc/keystone/keystone.conf
[DEFAULT]
# token:0c7030a400cf77890c75
# token值要与后文统一
admin_token = 0c7030a400cf77890c75
[database]
# 注释掉原connection
# 根据实际情况修改密码
connection = mysql+pymysql://keystone:0901@object/keystone
# 在第1987行
[token]
provider = fernet
同步keystone数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
初始化Fernet键
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
配置apache2.conf
vim /etc/apache2/apache2.conf
# 在文件前面添加该项
ServerName object
新建并配置wsgi-keystone.conf
vim /etc/apache2/sites-available/wsgi-keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/apache2/keystone.log
CustomLog /var/log/apache2/keystone_access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/apache2/keystone.log
CustomLog /var/log/apache2/keystone_access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
使apache支持虚拟机的身份认证服务
ln -s /etc/apache2/sites-available/wsgi-keystone.conf /etc/apache2/sites-enabled
重启appache服务
service apache2 restart
删除SQLite数据库文件
rm -f /var/lib/keystone/keystone.db
配置身份验证令牌
# token值要与前文统一
export OS_TOKEN=0c7030a400cf77890c75
配置Endpoint的URL
export OS_URL=http://object:35357/v3
配置API版本
export OS_IDENTITY_API_VERSION=3
创建identity服务实体
# 执行结果为表格
openstack service create --name keystone --description "OpenStack Identity" identity
创建identity服务endpoint
# 执行结果为表格
openstack endpoint create --region RegionOne identity public http://object:5000/v3
openstack endpoint create --region RegionOne identity internal http://object:5000/v3
openstack endpoint create --region RegionOne identity admin http://object:35357/v3
创建一个默认的domain
# 执行结果为表格
openstack domain create --description "Default Domain" default
创建一个admin project
# 执行结果为表格
openstack project create --domain default --description "Admin Project" admin
创建一个admin user
# 此处会提示用户设置用户密码
# 执行结果为表格
openstack user create --domain default --password-prompt admin
创建一个admin role
# 执行结果为表格
openstack role create admin
将role添加到admin project和admin user里面去
# 此处无输出则执行正确
openstack role add --project admin --user admin admin
创建一个service project
# 执行结果为表格
openstack project create --domain default --description "Service Project" service
配置keystone-paste.ini
vim /etc/keystone/keystone-paste.ini
# 分别从[pipeline:public_api]、[pipeline:admin_api] and [pipeline:api_v3] 移除 admin_token_auth
移除临时token
unset OS_TOKEN OS_URL
作为admin管理员请求一个身份验证令牌
# 提示输入admin的密码
# 执行结果为表格
openstack --os-auth-url http://object:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue
简化操作
# 将环境变量写入配置文件
# 简化每次重启主机后需加载脚本的操作
# 直接在命令行执行以下命令,再遇到需要加载脚本时就不需要执行了
echo "export OS_PROJECT_DOMAIN_NAME=default" >> /etc/profile
echo "export OS_USER_DOMAIN_NAME=default" >> /etc/profile
echo "export OS_PROJECT_NAME=admin" >> /etc/profile
echo "export OS_USERNAME=admin" >> /etc/profile
# 注意修改密码
echo "export OS_PASSWORD=0901" >> /etc/profile
echo "export OS_AUTH_URL=http://object:35357/v3" >> /etc/profile
echo "export OS_IDENTITY_API_VERSION=3" >> /etc/profile
echo "export OS_IMAGE_API_VERSION=2" >> /etc/profile
重新加载配置文件
source /etc/profile
请求获取令牌
openstack token issue
Swift单节点安装
创建swift用户
# 此处会提示用户设置用户密码
# 执行结果为表格
openstack user create --domain default --password-prompt swift
将admin role添加到swift user
# 此处无输出则正确
openstack role add --project service --user swift admin
创建Object Storage服务实体
# 执行结果为表格
openstack service create --name swift --description "OpenStack Object Storage" object-store
创建Object Storage服务endpoint
openstack endpoint create --region RegionOne object-store public http://object:8080/v1/AUTH_%\(tenant_id\)s
openstack endpoint create --region RegionOne object-store internal http://object:8080/v1/AUTH_%\(tenant_id\)s
openstack endpoint create --region RegionOne object-store admin http://object:8080/v1
安装软件包
apt-get install swift swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached
创建swift目录
mkdir -p /etc/swift
从对象存储源仓库中获取代理服务配置文件
# 耐心等待,可能获取失败
curl -o /etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?h=stable/mitaka
配置proxy-server.conf
vim /etc/swift/proxy-server.conf
[DEFAULT]
bind_port = 8080
user = swift
swift_dir = /etc/swift
# 从[pipeline:main]中移除tempurl和tempauth,添加authtoken和keystoneauth,请不要改变模块的顺序;
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = True
# 配置文件中有,但被注释掉了,直接添加即可
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin,user
# 配置文件中有,但被注释掉了,直接添加即可
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://object:5000
auth_url = http://object:35357
memcached_servers = object:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = swift
password = 0901
delay_auth_decision = True
[filter:cache]
use = egg:swift#memcache
memcache_servers = object:11211
磁盘模拟存储节点
# 模拟两个存储节点,每个节点2个空磁盘
# 关闭虚拟机,为我们的虚拟机添加4个10G的空磁盘;
# 虚拟机磁盘名称:sda(系统区)、sdb、sdc、sdd、sde;
# 验证检查,查看是否有以上磁盘;
ls /dev/sd*
安装软件包
apt-get install xfsprogs rsync
格式化空磁盘
mkfs.xfs /dev/sdb
mkfs.xfs /dev/sdc
mkfs.xfs /dev/sdd
mkfs.xfs /dev/sde
创建挂载点目录结构
mkdir -p /srv/node/sdb
mkdir -p /srv/node/sdc
mkdir -p /srv/node/sdd
mkdir -p /srv/node/sde
配置fstab(自动挂载)
vim /etc/fstab
# 以下内容追加到配置文件
/dev/sdb /srv/node/sdb xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sdc /srv/node/sdc xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sdd /srv/node/sdd xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sde /srv/node/sde xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
挂载设备
mount /srv/node/sdb
mount /srv/node/sdc
mount /srv/node/sdd
mount /srv/node/sde
配置rsyncd.conf
vim /etc/rsyncd.conf
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
# 本机 IP 地址
address = 192.168.10.55
[account]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/account.lock
[container]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/container.lock
[object]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/object.lock
配置开启rsync服务
vim /etc/default/rsync
RSYNC_ENABLE=true
启动rsyns服务
service rsync start
安装软件包
apt-get install swift swift-account swift-container swift-object
获取配置文件
# 耐心等待,可能获取失败
curl -o /etc/swift/account-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/mitaka
curl -o /etc/swift/container-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/mitaka
curl -o /etc/swift/object-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/mitaka
配置account-server.conf
vim /etc/swift/account-server.conf
[DEFAULT]
# 本机 IP 地址
bind_ip = 192.168.10.55
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon account-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
配置container-server.conf
vim /etc/swift/container-server.conf
[DEFAULT]
# 本机 IP 地址
bind_ip = 192.168.10.55
bind_port = 6001
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon container-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
配置object-server.conf
vim /etc/swift/object-server.conf
[DEFAULT]
# 本机 IP 地址
bind_ip = 192.168.10.55
bind_port = 6000
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = True
[pipeline:main]
pipeline = healthcheck recon object-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
修改挂载点的权限
chown -R swift:swift /srv/node
创建recon目录并设置权限
mkdir -p /var/cache/swift
chown -R root:swift /var/cache/swift
chmod -R 775 /var/cache/swift
创建并分配初始化环(rings)
切换到swift目录
cd /etc/swift
创建account.builder文件
# 此处无输出则正确
swift-ring-builder account.builder create 10 3 1
将每个存储节点添加到环(ring)中
swift-ring-builder account.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6002 --device sdb --weight 100
swift-ring-builder account.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6002 --device sdc --weight 100
swift-ring-builder account.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6002 --device sdd --weight 100
swift-ring-builder account.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6002 --device sde --weight 100
验证操作
swift-ring-builder account.builder
平衡环
swift-ring-builder account.builder rebalance
切换到swift目录
cd /etc/swift
创建container.builder文件
# 此处无输出则正确
swift-ring-builder container.builder create 10 3 1
将每个存储节点添加到环(ring)中
swift-ring-builder container.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6001 --device sdb --weight 100
swift-ring-builder container.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6001 --device sdc --weight 100
swift-ring-builder container.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6001 --device sdd --weight 100
swift-ring-builder container.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6001 --device sde --weight 100
验证操作
swift-ring-builder container.builder
平衡环
swift-ring-builder container.builder rebalance
切换到swift目录
cd /etc/swift
创建object.builder文件
# 此处无输出则正确
swift-ring-builder object.builder create 10 3 1
将每个存储节点添加到环(ring)中
swift-ring-builder object.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6000 --device sdb --weight 100
swift-ring-builder object.builder add --region 1 --zone 1 --ip 192.168.10.55 --port 6000 --device sdc --weight 100
swift-ring-builder object.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6000 --device sdd --weight 100
swift-ring-builder object.builder add --region 1 --zone 2 --ip 192.168.10.55 --port 6000 --device sde --weight 100
验证操作
swift-ring-builder object.builder
平衡环
swift-ring-builder object.builder rebalance
从源仓库获取swift.conf
# 耐心等待,可能获取失败
curl -o /etc/swift/swift.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?h=stable/mitaka
配置swift.conf
vim /etc/swift/swift.conf
[swift-hash]
# suffix与prefix自定义
swift_hash_path_suffix = Ben
swift_hash_path_prefix = Ben
[storage-policy:0]
name = Policy-0
default = yes
设置权限
chown -R root:swift /etc/swift
重启服务
service memcached restart
service swift-proxy restart
swift-init all start
查看swift状态
swift stat
创建容器Ben
openstack container create Ben
上传测试文件到容器Ben
# 文件需要我们自行去创建
# 注意 FILENAME 的修改
openstack object create Ben FILENAME
列出容器 Ben 存储的FILES
openstack object list Ben
下载容器Ben存储的FILENAME
# 此处无输出则正确
openstack object save Ben FILENAME
swift(Object Storage对象存储服务)(单节点)的更多相关文章
- 九、Swift对象存储服务(双节点搭建)
九.Swift对象存储服务(双节点搭建) 要求:Controoler节点需要2块空盘 Compute节点需要再加2块空盘 本次搭建采用Controller 和 Compute双节点节点做swift组件 ...
- 对象存储服务(Object Storage Service,简称 OSS)
阿里云对象存储服务(Object Storage Service,简称 OSS),是阿里云提供的海量.安全.低成本.高可靠的云存储服务.它具有与平台无关的RESTful API接口,能够提供99.99 ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 二
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四
openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstac ...
- 对象存储服务-Minio
Mino 目录 Mino 对象存储服务 Minio 参考 Minio 架构 为什么要用 Minio 存储机制 纠删码 MinIO概念 部署 单机部署: Docker 部署Minio 分布式Minio ...
- 使用 HDFS 协议访问对象存储服务
背景介绍 原生对象存储服务的索引是扁平化的组织形式,在传统文件语义下的 List 和 Rename 操作性能表现上存在短板.腾讯云对象存储服务 COS 通过元数据加速功能,为上层计算业务提供了等效于 ...
- 阿里云对象存储服务,OSS使用经验总结,图片存储,分页查询
阿里云OSS-使用经验总结,存储,账号-权限,分页,缩略图,账号切换 最近项目中,需要使用云存储,最后选择了阿里云-对象存储服务OSS.总的来说,比较简单,但是仍然遇到了几个问题,需要总结下. 1.O ...
随机推荐
- 014对象——对象 __isset __unset __sleep __wakeup
<?php /** * */ /*class lantian { public $name; public $age; private $money; public $c; function _ ...
- ElasticSearch6.0 Java API 使用 排序,分组 ,创建索引,添加索引数据,打分等(一)
ElasticSearch6.0 Java API 使用 排序,分组 ,创建索引,添加索引数据,打分等 如果此文章对你有帮助,请关注一下哦 1.1 搭建maven 工程 创建web工程 ...
- .NET学习路线之我见(转)
这是我的第一篇博客,所以,我想写个大的,至少这个话题是比较大的. 在文章的开头,首先声明,这篇文章仅代表我个人的想法,并且只适合.NET的初学者,如果你已经有两年以上的开发经验,我劝你还是别看了,省得 ...
- webpack 使用中的问题
用gulp-watch代替watch webpack打包体积分析器 集合
- redux源码阅读之compose,applyMiddleware
我的观点是,看别人的源码,不追求一定要能原样造轮子,单纯就是学习知识,对于程序员的提高就足够了.在阅读redux的compose源码之前,我们先学一些前置的知识. redux源码阅读之compose, ...
- 持久层框架:MyBatis 3.2(1)
MyBatis 的前身就是 iBatis .是一个数据持久层(ORM)框架. iBATIS一词来源于“internet”和“abatis”的组合,是一个基于Java的持久层框架.iBATIS提供的持久 ...
- bat中for /f 如何截取任意行
一.概述 for命令开关有很多,/L,/F,/R.这里仅对含有/F的for进行分析,这个可能是最常用的,也是最强的命令,主要用来处理文件和一些命令的输出结果. 1.命令格式:(1).FOR /F [& ...
- mac和linux下使用Docker,部署SpringBoot项目到docker
主要是看一下如何在linux及mac上安装docker,创建docker镜像,部署SpringBoot项目到docker,并借助于DaoCloud进行docker镜像下载加速等. 我用的电脑是mac, ...
- canvas 创建渐变图形
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- VS 2010 转到COFF期间失败。
可能的原因是framework 版本不匹配,我卸载4.5,装4.0后就解决了