共计 4075 个字符,预计需要花费 11 分钟才能阅读完成。
kanyun 的部署
- 1 全部节点配置
- 1.1 安装 zmq
- 1.2 安装 kanyun
- 2 控制节点配置
- 2.1 安装配置 cassandra
- 2.2 启动和配置 kanyun
- 3 计算节点配置
- 3.1 启动和配置 kanyun
1 全部节点
1.1 安装 zmq
安装 zerozmq(2.2.0)
- yum install libtool autoconf automake
- yum install uuid-devel
- yum install libuuid-devel
- wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
- tar zxvf zeromq-2.2.0.tar.gz & cd zeromq-2.2.0 & ./configure & make install
- ldconfig
安装 pyzmq
- easy_install“pyzmq==2.2.0”
- 如果出现缺少 libzmq.so.1 的情况,可能是链接库没有正确配置。
-
sudo /sbin/ldconfig -v grep libzmq 查看是否有所需链接 -
如果没有 libzmq.so.1 -> libzmq.so.1.0.1,则修改 /etc/ld.so.conf,在末尾增加 /usr/local/lib,然后 ldconfig -v grep libzmq 即可 - 如果出现缺少 Python.h,则使用 yum install python-devel 来安装
1.2 安装 kanyun
下载代码
kanyun 原来的代码有 bug,而且不能在 python2.6 环境下使用,下面是我改过的
cd /opt
git clone https://github.com/suyan/kanyun.git
修改内容:
- 兼容 python2.6 和 2.7(python2.6 需要安装 OrderedDict)
- 修改获取内存信息方式和计算 cpu 使用率方式
- 修复一些 bug
安装
python /opt/kanyun/setup.py install
创建日志目录
mkdir /var/log/kanyun
安装 OrderedDict(python2.6)
easy_install OrderedDict
2 控制节点
2.1 安装配置 cassandra
下载 Cassandra
cd /opt
wget http://mirror.bit.edu.cn/apache/cassandra/0.8.10/apache-cassandra-0.8.10-bin.tar.gz
解压
tar zxvf apache-cassandra-0.8.10-bin.tar.gz
运行
/opt/apache-cassandra-0.8.10/bin/cassandra
创建数据库
通过命令打开数据库
/opt/apache-cassandra-0.8.10/bin/cassandra-cli -h 127.0.0.1
并执行下面命令
CREATE keyspace DATA;
USE DATA;
CREATE COLUMN family vmnetwork WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family cpu WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family mem_max WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family mem_free WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family nic_incoming WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family nic_outgoing WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family blk_read WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
CREATE COLUMN family blk_write WITH column_type='Super' AND comparator='AsciiType' AND subcomparator='IntegerType' AND default_validation_class='AsciiType';
assume vmnetwork KEYS AS ascii;
assume cpu KEYS AS ascii;
assume mem_max KEYS AS ascii;
assume nic_incoming KEYS AS ascii;
assume nic_outgoing KEYS AS ascii;
assume blk_read KEYS AS ascii;
assume blk_write KEYS AS ascii;
assume mem_free KEYS AS ascii;
安装 pycassa 支持
easy_install pycassa
如果出现 The required version of distribute is not available
easy_install -U distribute
2.2 启动和配置 kanyun
配置 /etc/kanyun.conf
- 文件中 host 需要填写计算节点的 ip
- sql_connection 填写 nova.conf 中 connection 值
配置文件
[kanyun]
log: /var/log/kanyun/kanyun.log
[DEFAULT]
sql_connection: mysql://nova:novamysqlpassword@controller/nova
[server]
host: 172.19.9.1
port: 5551
db_host: 127.0.0.1
log: /var/log/kanyun/kanyun-server.log
[api]
api_host: 172.19.9.1
api_port: 5552
db_host: 127.0.0.1
log: /var/log/kanyun/kanyun-api.log
[client]
api_host: 172.19.9.1
api_port: 5552
log: /var/log/kanyun/kanyun-client.log
启动服务
python /opt/kanyun/bin/kanyun-server &
python /opt/kanyun/bin/kanyun-api &
3 计算节点
3.1 启动和配置 kanyun
配置 /etc/kanyun.conf
- 文件中 api_host 需要填写计算节点的 ip
- sql_connection 填写 nova.conf 中 connection 值
- id 根据节点编号自己设置
配置文件
[kanyun]
log: /var/log/kanyun/kanyun.log
[DEFAULT]
sql_connection: mysql://nova:novamysqlpassword@controller/nova
[worker]
id: worker1
worker_timeout: 60
dataserver_host: 172.19.9.1
dataserver_port: 5551
log: /var/log/kanyun/kanyun-worker.log
[client]
api_host: 172.19.9.1
api_port: 5552
log: /var/log/kanyun/kanyun-client.log
启动服务
python /opt/kanyun/bin/kanyun-worker &
下面是小编为你精选的 Openstack 相关知识,看看是否有你喜欢的 :
在 Ubuntu 12.10 上安装部署 Openstack http://www.linuxidc.com/Linux/2013-08/88184.htm
Ubuntu 12.04 OpenStack Swift 单节点部署手册 http://www.linuxidc.com/Linux/2013-08/88182.htm
OpenStack 云计算快速入门教程 http://www.linuxidc.com/Linux/2013-08/88186.htm
企业部署 OpenStack:该做与不该做的事 http://www.linuxidc.com/Linux/2013-09/90428.htm
CentOS 6.5 x64bit 快速安装 OpenStack http://www.linuxidc.com/Linux/2014-06/103775.htm
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-08/121573.htm
正文完
星哥玩云-微信公众号