摘要: 配置参数设置://shardingShard Server1 192.168.0.5:20000 dbpath /data/liumongodb/data/shard1/data/ logpath dbpath /data/liumongodb/data/shard1/data/log/log.logShard Server2 192.168.0.5:20001 dbpath /data/liumongodb/data/shard2/data/ logpath dbpath /data/liumongodb/data/shard2/data/log/log.logConfig Server 1 阅读全文
posted @ 2012-11-20 16:55 Linux、Mongo、Php、Shell、Python、C 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 利用makefile功能对文件的c语言进行编译是非常方便的事情今天开始linuxC的学习,用这片博客记录自己C的学习历程: /* main.c */ #include "mytool1.h" #include "mytool2.h" int main(int argc,char **argv) { mytool1_print("hello"); mytool2_print("hello"); } /* mytool1.h */ #ifndef _MYTOOL_1_H #define _MYTOOL_1_H void 阅读全文
posted @ 2012-11-20 11:05 Linux、Mongo、Php、Shell、Python、C 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 一、MongoDB Replica Sets(副本集)简单的说就是有自动故障恢复功能的主从集群,主从集群和副本集的最为明显的区别是副本集没有固定的"主节点":整个集群会选举出来一个"主节点"当其不能正常工作时则变更到其他的节点,提高了系统的稳定性。 MongoDB Replica Sets的架构如图所示: 如上图所示,MongoDB Replica Sets的结构类似于以集群,完全可以把他当成一个集群,因为他确实与集群实现的作用是一样的:如果其中一个节点出现故障,其他的节点会马上将业务接管过来。而无需停机操作 二、MongoDB Replica Sets 阅读全文
posted @ 2012-11-20 11:03 Linux、Mongo、Php、Shell、Python、C 阅读(479) 评论(0) 推荐(0) 编辑
摘要: 1<?phpif(!defined('BASEPATH'))exit('Nodirectscriptaccessallowed');2/**3*CodeIgniter4*5*AnopensourceapplicationdevelopmentframeworkforPHP5.1.6ornewer6*7*@packageCodeIgniter8*@authorExpressionEngineDevTeam9*@copyrightCopyright(c)2008-2011,EllisLab,Inc.10*@licensehttp://codeigniter.c 阅读全文
posted @ 2012-11-20 10:49 Linux、Mongo、Php、Shell、Python、C 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1<?phpif(!defined('BASEPATH'))exit('Nodirectscriptaccessallowed');2/**3*CodeIgniter4*5*AnopensourceapplicationdevelopmentframeworkforPHP5.1.6ornewer6*7*@packageCodeIgniter8*@authorExpressionEngineDevTeam9*@copyrightCopyright(c)2008-2011,EllisLab,Inc.10*@licensehttp://codeigniter.c 阅读全文
posted @ 2012-11-20 10:34 Linux、Mongo、Php、Shell、Python、C 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 1<?phpif(!defined('BASEPATH'))exit('Nodirectscriptaccessallowed');2/**3*CodeIgniter4*5*AnopensourceapplicationdevelopmentframeworkforPHP5.1.6ornewer6*7*@packageCodeIgniter8*@authorExpressionEngineDevTeam9*@copyrightCopyright(c)2008-2011,EllisLab,Inc.10*@licensehttp://codeigniter.c 阅读全文
posted @ 2012-11-20 10:24 Linux、Mongo、Php、Shell、Python、C 阅读(279) 评论(0) 推荐(0) 编辑
摘要: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');/*** CodeIgniter** An open source application development framework for PHP 5.1.6 or newer** @package CodeIgniter* @author ExpressionEngine Dev Team* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.* @li 阅读全文
posted @ 2012-11-20 10:08 Linux、Mongo、Php、Shell、Python、C 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 1<?php23/*4*---------------------------------------------------------------5*APPLICATIONENVIRONMENT6*---------------------------------------------------------------7*8*Youcanloaddifferentconfigurationsdependingonyour9*currentenvironment.Settingtheenvironmentalsoinfluences10*thingslikeloggingander 阅读全文
posted @ 2012-11-20 08:36 Linux、Mongo、Php、Shell、Python、C 阅读(1689) 评论(0) 推荐(0) 编辑
摘要: xhprof的安装是很简单,记录下其在php函数中的使用代码别让自己给忘记了:public static function startXhprof() { if (function_exists('xhprof_enable')) { xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); } } public static function showXhprof() { if (function_exists('xhprof_enable') && function_exists(' 阅读全文
posted @ 2012-11-12 08:56 Linux、Mongo、Php、Shell、Python、C 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 电子商务平台都会有对客户发布信息的审核,同时审核人员有很多,如何达到高效不重复的信息审核,我根据我自己的理解设计了下利用memcahce+队列(httsqs) 处理网站的信息审核。直接上流程图:这个还在完善当中。 阅读全文
posted @ 2012-11-10 09:24 Linux、Mongo、Php、Shell、Python、C 阅读(295) 评论(0) 推荐(0) 编辑
摘要: Yaf(Yet Another Framework) (另外一种框架(自己的理解))(摘抄)yaf优点: 1.用C语言开发的PHP框架, 相比原生的PHP, 几乎不会带来额外的性能开销. 2.所有的框架类, 不需要编译, 在PHP启动的时候加载, 并常驻内存. 3.更短的内存周转周期, 提高内存利用率, 降低内存占用率. 4.灵巧的自动加载. 支持全局和局部两种加载规则, 方便类库共享. 5.高性能的视图引擎. 6.高度灵活可扩展的框架, 支持自定义视图引擎, 支持插件, 支持自定义路由等等. 7.内建多种路由, 可以兼容目前常见的各种路由协议. 8.强大而又高度灵活的配置文件支持. 并支持缓 阅读全文
posted @ 2012-11-10 08:51 Linux、Mongo、Php、Shell、Python、C 阅读(1853) 评论(0) 推荐(0) 编辑
摘要: 在yaf引入smartys3作为视图的出现了如下错误:Warning: Yaf_Loader::autoload() [yaf-loader.autoload]: Failed opening script /home/www/yafwww/application/library/Smarty/Internal/TemplateCompilerBase.php: No such file or directory in /home/www/yafwww/application/library/Smarty/sysplugins/smarty_internal_smartytemplateco. 阅读全文
posted @ 2012-11-04 18:13 Linux、Mongo、Php、Shell、Python、C 阅读(3238) 评论(0) 推荐(0) 编辑
摘要: #include <stdlib.h>#include <stdio.h>#include <mysql/mysql.h>int main(void){MYSQL_RES *res_ptr;MYSQL_ROW sqlrow;MYSQL *conn_ptr;int result;//query resultint iTableRow,iTableCol,i,j;conn_ptr = mysql_init(NULL);if (!conn_ptr){ fprintf(stderr,"mysql_init failed!\n"); return 阅读全文
posted @ 2012-10-19 20:51 Linux、Mongo、Php、Shell、Python、C 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 整个流程的步骤如下:1:安装setiptools工具2:安装PIP3:安装DEx4:测试。相关步骤如下:1:[root@bogon ~]# yun update python2:[root@bogon ~]# yum install setiptools3:[root@bogon ~]# pip-python install -U pip4:[root@bogon ~]# pip install dex5:三、dex使用方法,转自http://blog.nosqlfan.com/html/4061.html 阅读全文
posted @ 2012-10-12 11:36 Linux、Mongo、Php、Shell、Python、C 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 2012-09-13:1:nginx:负载均衡的基本原理和实现的方法。2:mongodb: 各种查询及索引的学习。3:mysql:innodb相关只是2012-09-14由于今天项目进度的原因耽误了学习的进度。2012-09-15Mongodb的英文文档,发现了书上没有的很多东西,还是文档重要。nginx 终于配置成了简单的负载均衡,下一步做更深入的了解。python 了解的异常的处理方法。 阅读全文
posted @ 2012-09-13 20:14 Linux、Mongo、Php、Shell、Python、C 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 今天突发奇想决定有博客记录自己的学习历程,从基本的知识入手,让自己慢慢的成为一个It达人2012-09-12:1:nginx:今天对nginx的负载均衡进行了解学习,明天负载均衡的基本原理和实现的方法,明日亲自配置一下。2:mongodb:自己学习mongodb已有半年多的时间了对mongodb有了一定的了解并将其应用到项目中,配置了主从和副本集,但是还没有对分片进行过研究和实践接下里要深入的了解mongodb并配置其分片,然后在本地测试后能应用到生成环境中,同时还要对javascript有了解。3:mysql:现在自己能对sql语句优化,mysql的主从配置都进行过研究和测试,接下来的时间中 阅读全文
posted @ 2012-09-12 20:20 Linux、Mongo、Php、Shell、Python、C 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1:首先 ifconfig:[root@company network-scripts]# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:EB:26:7E inet addr:192.168.0.223 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:feeb:267e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:180734 errors:91 dro. 阅读全文
posted @ 2012-09-10 18:54 Linux、Mongo、Php、Shell、Python、C 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 在处理mysql->mongodb数据时发现了如下错误:Fatal error: Uncaught exception 'MongoCursorException' with message 'couldn't get response header' in /home/web1/mongodbliu/product.php:69 Stack trace: #0 /home/web1/mongodbliu/product.php(69): MongoCollection->findOne(Array) #1 {main} thrown in 阅读全文
posted @ 2012-09-01 09:29 Linux、Mongo、Php、Shell、Python、C 阅读(1837) 评论(0) 推荐(0) 编辑
摘要: 在安装mongodb的DEX工具时需要用到pip命令:$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py$ python get-pip.py 阅读全文
posted @ 2012-08-17 16:01 Linux、Mongo、Php、Shell、Python、C 阅读(4301) 评论(0) 推荐(0) 编辑
摘要: # svn checkouthttp://svn.usrportage.de/php-mogilefs/trunk# cd trunk# phpize# ../configure --with-php-config=/opt/php/bin/php-config/**checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613checking for PHP installed headers prefix... /usr/local/php/include 阅读全文
posted @ 2012-07-11 16:31 Linux、Mongo、Php、Shell、Python、C 阅读(467) 评论(0) 推荐(0) 编辑