firefly如何安装mysql_CentOS7 安装Firefly及测试
本文記錄CentOS7安裝Firefly的過程及遇到的錯(cuò)誤
安裝也可以同時(shí)參考社區(qū)提供的文章:
http://www.9miao.com/forum.php?mod=viewthread&tid=33009&fromuid=87
沒有安裝mysql的請先參考這篇文章,快速安裝:
http://blog.csdn.net/alex_my/article/details/44711139
1 安裝第三方庫:
easy_install twisted
easy_install python-memcached
easy_install DBUtils
easy_install zope.interface
easy_install affinity
easy_install MySQL-python
2 遇到的問題
-1: twisted
問題:twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
解決方法:安裝python-dev
yum -y install python-devel.x86_64
-2: MySQL-python
問題:mysql_config not found
原因:mysql_config位置不對,而我是就沒有安裝mysql,安裝好后沒有遇到該問題。
解決方法:來自社區(qū)參考文章
方法1:
sudo ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
將mysql_confi從你的安裝目錄鏈接到/usr/local/bin目錄下,這樣就可以在任意目錄下訪問了(也可以放到/usr/bin)
方法2:
編輯源碼文件夾的site.cfg文件,去掉#mysql_config =? /usr/local/bin/mysql_config前的注釋#,修改后面的路徑為你的mysql_config真正的目錄就可以了。(如果不知道 mysql_config在哪里,運(yùn)行命令:whereis mysql_config)
3 檢測是否正常安裝
-1:創(chuàng)建一個(gè)新的工程
firefly-admin.py createproject Test
cd Test
-2: 修改config.json配置
--1:普通用戶無法使用1000端口號(hào),所以,netport使用的1000請修改為其它值,比如10000
--2:db-passwd請修改為自己所使用的mysql密碼,比如123456
-3:運(yùn)行
python startmaster.py
輸出:
2015-03-29 00:04:01+0800 [-] Log opened.
2015-03-29 00:04:01+0800 [-] DelaySite starting on 9998
2015-03-29 00:04:01+0800 [-] Starting factory
2015-03-29 00:04:01+0800 [-] BilateralFactory starting on 9999
2015-03-29 00:04:01+0800 [-] Starting factory
/usr/lib/python2.7/site-packages/pkg_resources.py:1054: UserWarning: /home/alex-my/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the
PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
/usr/lib/python2.7/site-packages/pkg_resources.py:1054: UserWarning: /home/alex-my/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or
the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
2015-03-29 00:04:01+0800 [-] Log opened.
2015-03-29 00:04:01+0800 [-] Log opened.
2015-03-29 00:04:01+0800 [-] Starting factory
2015-03-29 00:04:01+0800 [-] Starting factory
2015-03-29 00:04:01+0800 [-] gate start...
2015-03-29 00:04:01+0800 [-] gate pid: 3431
2015-03-29 00:04:01+0800 [-] net start...
2015-03-29 00:04:01+0800 [-] net pid: 3432
2015-03-29 00:04:01+0800 [BilateralBroker,0,127.0.0.1] node [gate] takeProxy ready
2015-03-29 00:04:01+0800 [BilateralBroker,1,127.0.0.1] node [net] takeProxy ready
2015-03-29 00:04:01+0800 [Broker,client] call method remote_connect on service[single]
2015-03-29 00:04:01+0800 [Broker,client] Starting factory
2015-03-29 00:04:01+0800 [BilateralBroker,0,127.0.0.1] node [net] takeProxy ready
-4: 修復(fù)警告
過程中出現(xiàn)一個(gè)大意是說~/.python-eggs不安全
解決方案:
chmod g-w ~/.python-eggs/??? # 將group的寫權(quán)限去除
chmod o-w ~/.python-eggs/?? ? # 將other的寫權(quán)限去除
-5: 一個(gè)更具體的示例:多人聊天室
請移步:http://www.9miao.com/forum.php?mod=viewthread&tid=43974&fromuid=87
總結(jié)
以上是生活随笔為你收集整理的firefly如何安装mysql_CentOS7 安装Firefly及测试的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php和mysql的版本区别_MySQL
- 下一篇: mysql查询无限下级_示例php+my