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即可 |
kanyun原来的代码有bug,而且不能在python2.6环境下使用,下面是我改过的
cd /opt
git clone https://github.com/suyan/kanyun.git
修改内容:
python /opt/kanyun/setup.py install
mkdir /var/log/kanyun
easy_install OrderedDict
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;
easy_install pycassa
如果出现The required version of distribute is not available
easy_install -U distribute
配置文件
[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 &
配置文件
[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 &