阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

在OpenStack中部署kanyun

139次阅读
没有评论

共计 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)

  1. yum install libtool autoconf automake
  2. yum install uuid-devel
  3. yum install libuuid-devel
  4. wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
  5. tar zxvf zeromq-2.2.0.tar.gz & cd zeromq-2.2.0 & ./configure & make install
  6. ldconfig

安装 pyzmq

  1. easy_install“pyzmq==2.2.0”
  2. 如果出现缺少 libzmq.so.1 的情况,可能是链接库没有正确配置。
  3. sudo /sbin/ldconfig -v grep libzmq 查看是否有所需链接
  4. 如果没有 libzmq.so.1 -> libzmq.so.1.0.1,则修改 /etc/ld.so.conf,在末尾增加 /usr/local/lib,然后 ldconfig -v grep libzmq 即可
  5. 如果出现缺少 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

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计4075字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中