腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
蓝天
专栏成员
举报
526
文章
865691
阅读量
41
订阅数
订阅专栏
申请加入专栏
全部文章(526)
其他(257)
linux(50)
编程算法(27)
云数据库 Redis(25)
https(21)
人工智能(19)
c++(18)
shell(17)
unix(15)
http(15)
安全(15)
hadoop(14)
node.js(13)
云数据库 SQL Server(13)
bash(12)
打包(12)
网络安全(11)
java(10)
javascript(10)
github(10)
apache(10)
存储(10)
grep(9)
html(8)
分布式(8)
rpc(8)
gcc(8)
git(7)
开源(7)
ssh(7)
windows(7)
.net(6)
数据库(6)
bash 指令(6)
zookeeper(6)
kernel(6)
大数据(6)
c#(5)
sql(5)
正则表达式(5)
udp(5)
json(4)
汇编语言(4)
api(4)
容器(4)
缓存(4)
hbase(4)
nat(4)
进程(4)
php(3)
lua(3)
xml(3)
ide(3)
jdk(3)
erp(3)
dns(3)
tcp/ip(3)
ps(3)
go(2)
access(2)
maven(2)
ubuntu(2)
容器镜像服务(2)
运维(2)
数据迁移(2)
面向对象编程(2)
ftp(2)
数据分析(2)
awk(2)
free(2)
glibc(2)
ip(2)
malloc(2)
service(2)
session(2)
变量(2)
函数(2)
脚本(2)
状态机(2)
c 语言(1)
python(1)
ruby(1)
bootstrap(1)
jquery(1)
makefile(1)
oracle(1)
nosql(1)
mvc(1)
ruby on rails(1)
eclipse(1)
svn(1)
jar(1)
nginx(1)
apt-get(1)
spring(1)
命令行工具(1)
TDSQL MySQL 版(1)
全站加速网络(1)
知识图谱(1)
云推荐引擎(1)
yarn(1)
kubernetes(1)
自动化(1)
压力测试(1)
html5(1)
jvm(1)
yum(1)
jdbc(1)
ntp(1)
微信(1)
数据结构(1)
系统架构(1)
架构设计(1)
kafka(1)
迁移(1)
raft(1)
flink(1)
agent(1)
cmd(1)
directory(1)
dispatcher(1)
eval(1)
file(1)
fork(1)
md5(1)
pdf(1)
pid(1)
rss(1)
send(1)
sizeof(1)
sleep(1)
substr(1)
thrift(1)
volatile(1)
编译器(1)
程序(1)
磁盘(1)
代码质量(1)
后台开发(1)
集群(1)
架构师(1)
内核(1)
软件(1)
设计(1)
系统(1)
线程池(1)
协议(1)
性能(1)
用户体验(1)
优化(1)
重构(1)
搜索文章
搜索
搜索
关闭
Zookeeper C++编程实战之主备切换
其他
默认zookeeper日志输出到stderr, 可以调用zoo_set_log_stream(FILE*)设置输出到文件中 还可以调用zoo_set_debug_level(ZooLogLevel)控制日志级别!!! 类CZookeeperHelper提供基于zookeeper的主备切换接口和读取数据等接口: https://github.com/eyjian/libmooon/blob/master/include/mooon/net/zookeeper_helper.h 使用示例:
一见
2018-12-13
612
0
Redis模块开发示例
其他
实现一个Redis module,支持两个扩展命令: 1) 可同时对hash的多个field进行incr操作; 2) incrby同时设置一个key的过期时间 在没有module之前,需要借助eval+lua实现相同的功能。有了module,不但可以实现逻辑复杂,且性能高的扩展,同时享受Redis的持久化和容灾能力。
一见
2018-12-10
948
0
几种修改Linux主机名的方法
其他
在安装一些系统时,需要修改hostname,比如安装Hadoop时需要修改主机名,而且主机名不能包含下划线。
一见
2018-09-30
3.7K
0
巧用NULL模式解耦依赖
其他
由于需求的变化,应用B需要库libM.a的能力,以便和服务M交互。为了复用和简化,通过类A间接提供,应用B不用修改代码,只需要重新编译即可获得新的能力,其它用到类A的应用也是如此。
一见
2018-09-30
521
0
Redis源码笔记-初步
其他
Redis代码优美,注释也很到位,阅读起来会赏心悦目,大大降低了理解门槛。由于redis单线程几乎完成所有工作,整体逻辑是相当复杂的,涉及了太多状态,作者的技术深厚可见一斑。
一见
2018-09-30
2.1K
0
Linux远程批量工具mooon_ssh和mooon_upload使用示例
其他
https://github.com/eyjian/libmooon/releases
一见
2018-09-30
892
0
Kafka常用命令收录
其他
本文内容主要来自两个方面:一是网上的分享,二是自研的随手记。日记月累,收录kafka各种命令,会持续更新。
一见
2018-09-30
6.3K
0
Redis-4.0.11集群配置
其他
本文参考官方文档而成:http://redis.io/topics/cluster-tutorial。经测试,安装过程也适用于redis-3.2.0、redis-4.0.11等。
一见
2018-09-30
2.6K
0
大压力下Redis参数调整要点
其他
最重要的原因之一Redis的主从复制,两者复制共享同一线程,虽然是异步复制的,但因为是单线程,所以也十分有限。如果主从间的网络延迟不是在0.05左右,比如达到0.6,甚至1.2等,那么情况是非常糟糕的,因此同一Redis集群一定要部署在同一机房内。
一见
2018-09-30
1.5K
0
查看Redis集群所有节点内存工具
其他
指定集群中任意一个节点,查看集群中所有节点当前已用物理内存、配置的最大物理内存和系统物理内存。 源码(可从下载):
一见
2018-09-30
2.5K
0
查看Redis集群主从对应关系工具
其他
源代码(可从https://github.com/eyjian/redis-tools下载):
一见
2018-09-30
2.1K
0
C/C++常见gcc编译链接错误解决方法
其他
用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdynamic”指定链接共享库,使用示例: -Wl,-Bstatic -lmysqlclient_r -lssl -lcrypto -Wl,-Bdynamic -lrt -Wl,-Bdynamic -pthread -Wl,-Bstatic -lgtest ("-Wl"表示是传递给链接器ld的参数,而不是编译器gcc/g++的参数。) 1) 下面是因为没有指定链接参数-lz(/usr/lib/libz.so,/usr/lib/libz.a ) /usr/local/mysql/lib/mysql/libmysqlclient.a(my_compress.c.o): In function `my_uncompress': /home/software/mysql-5.5.24/mysys/my_compress.c:122: undefined reference to `uncompress' /usr/local/mysql/lib/mysql/libmysqlclient.a(my_compress.c.o): In function `my_compress_alloc': /home/software/mysql-5.5.24/mysys/my_compress.c:71: undefined reference to `compress' 2) 下面是因为没有指定编译链接参数-pthread(注意不仅仅是-lpthraed) /usr/local/mysql/lib/mysql/libmysqlclient.a(charset.c.o): In function `get_charset_name': /home/zhangsan/mysql-5.5.24/mysys/charset.c:533: undefined reference to `pthread_once' 3) 下面这个是因为没有指定链接参数-lrt /usr/local/thirdparty/curl/lib/libcurl.a(libcurl_la-timeval.o): In function `curlx_tvnow': timeval.c:(.text+0xe9): undefined reference to `clock_gettime' 4) 下面这个是因为没有指定链接参数-ldl /usr/local/thirdparty/openssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': dso_dlfcn.c:(.text+0x4c): undefined reference to `dlopen' dso_dlfcn.c:(.text+0x62): undefined reference to `dlsym' dso_dlfcn.c:(.text+0x6c): undefined reference to `dlclose' 5) 下面这个是因为指定了链接参数-static,它的存在,要求链接的必须是静态库,而不能是共享库 ld: attempted static link of dynamic object 如果是以-L加-l方式指定,则目录下必须有.a文件存在,否则会报-l的库文件找不到:ld: cannot find -lACE 6) GCC编译遇到如下的错误,可能是因为在编译时没有指定-fPIC,记住:-fPIC即是编译参数,也是链接参数 relocation R_x86_64_32S against `vtable for CMyClass` can not be used when making a shared object 7) 下面的错误表示gcc编译时需要定义宏__STDC_FORMAT_MACROS,并且必须包含头文件inttypes.h test.cpp:35: error: expected `)' before 'PRIu64' 8) 下面是因为在x86机器(32位)上编译没有指定编译参数-march=pentium4 ../../src/common/libmooon.a(logger.o): In function `atomic_dec_and_test': ../../include/mooon/sys/atomic_gcc.h:103: undefined reference to `__sync_sub_and_fetch_4' 9) 下列错误可能是因为多了个“}” error: expected d
一见
2018-08-10
7.8K
0
GCC: error: expected `)' before 'PRIu64'
其他
printf("UniqID: %"PRIu64"\n", uniq_id); test.cpp:35: error: expected `)' before 'PRIu64' make: *** [test.o] 错误 1 上述错误,gcc编译时需要定义宏__STDC_FORMAT_MACROS,并且必须包含头文件inttypes.h。
一见
2018-08-10
1.5K
0
C++两种线程模式:委托和继承(附示例)
其他
继承方式实现简单,请参见:https://github.com/eyjian/mooon/blob/master/common_library/include/mooon/sys/thread.h 在C++11标准之前的实现较为复杂(可参见:https://github.com/eyjian/mooon/blob/master/common_library/include/mooon/sys/thread_engine.h): 委托版本使用非常简单:
一见
2018-08-10
939
0
代码中创建新终端
其他
最常见于使用SecureCRT等工具远程创建打开终端,下面的代码演示在代码中创建打开终端:
一见
2018-08-10
684
0
Thrift编译错误解决方法
其他
下面这个错误可能是因为DOS(Windows)和Unix文件格式问题: checking whether g++ supports C++11 features by default... no checking whether g++ supports C++11 features with -std=c++11... no configure: No compiler with C++11 support was found ./configure: line 16746: syntax error near unexpected token `fi' ./configure: line 16746: `fi' 解决方法是设置好git: [core] autocrlf = false safecrlf = true eol = lf 对应的命令为: git config --global core.autocrlf false git config --global core.safecrlf true git config --global core.eol lf 完成后,删除再重新从git上clone出来。 下面这个错误原因暂不清楚(configure时指定了--with-qt4=no,按理代码应当不会进入才对): checking for ranlib... (cached) ranlib checking whether g++ supports C++11 features by default... no checking whether g++ supports C++11 features with -std=c++11... no configure: No compiler with C++11 support was found ./configure: line 17658: syntax error near unexpected token `QT,' ./configure: line 17658: ` PKG_CHECK_MODULES(QT, QtCore >= 4.3, QtNetwork >= 4.3, have_qt=yes, have_qt=no)' 但可以编辑configure文件,然后将相应的行注释掉,如: # if test "$with_qt4" = "yes"; then # PKG_CHECK_MODULES(QT, QtCore >= 4.3, QtNetwork >= 4.3, have_qt=yes, have_qt=no) # fi 其它类似的错误都可以这样处理。 下面这个错误发生在x86_64上,也根据提示来操作: /usr/local/thirdparty/openssl/include/openssl/sha.h:184: error: ISO C++ does not support 'long long' /usr/local/thirdparty/openssl/include/openssl/sha.h:185: error: ISO C++ does not support 'long long' /usr/local/thirdparty/openssl/include/openssl/sha.h:187: error: ISO C++ does not support 'long long' 修改sha.h的相应代码行,将SHA_LONG64改成int64_t(需要#include )或long即可。
一见
2018-08-10
2.3K
0
Linux开发环境第三方库规划
其他
让工作变得有条理,不乱糟糟,即使存在大量的第三方,也有章可循。简而言之,就是要保持目录的干净(如/usr/local目录),保持文件的干净(如profile文件)
一见
2018-08-10
1.3K
0
automake编译和安装方式说明
其他
作为良好的习惯,建议为第三方库建立专门的目录,目录取名为thirdparty。然后,再在thirdparty下建立名叫src_package,用来存放第三方库的源码包,如没有特别说明,第三方库默认均为automake编译和安装方式。并且,一般建议将第三方库安装在thirdparty目录下,而不是系统的/usr/local目录下,目的是尽量减少对系统目录的污染,保持系统目录的整洁。 【automake编译和安装方式说明】 通常Linux系统自带automake编译工具,C/C++开源库一般都采用automake编译。 假设源代码库文件名为protobuf-2.4.1.tar.gz,则编译和安装操作步骤如下: 1) 将源代码包文件protobuf-2.4.1.tar.gz上传到Linux机上,这里假设上传到Linux机的/tmp目录 2) 进入/tmp目录 3) 解压源代码包文件:tar xzf protobuf-2.4.1.tar.gz,完成后会在/tmp目录下会出现一个子目录protobuf-2.4.1 4) 进入/tmp的子目录子目录protobuf-2.4.1 5) 执行configure命令,以生成Makefile文件:./configure --prefix=/usr/local/protobuf-2.4.1,这里假设将Protocol Buffers安装到/usr/local/protobuf-2.4.1 6) 上一步会生成编译用的Makefile文件,接下来执行make编译:make 7) make成功后,再执行make install安装 8) 成功后,就可以ls /usr/local/protobuf-2.4.1查看安装结果了; 9) 建立不带版本号的软链接:ln -s /usr/local/protobuf-2.4.1 /usr/local/protobuf 【automake编译和安装方式补充说明】 a) 源代码包如果是protobuf-2.4.1.tar.bz2形式,则表示是bzip2压缩包,而protobuf-2.4.1.tar.gz是gzip压缩包,对于bzip2压缩包,tar解压参数请由xzf改成xjf b) 上述第9步不是必须的,但会是一个良好的Linux风俗,建议保持 c) 注意第5步,如果生成的静态库会被其它共享库使用,则可能需要为configure增加参数,否则在链接生成共享库时,可能会报被链接的静态库需要带-fPIC参数重新编译,这个问题不难解决,如下变通一下即可: ./configure --prefix=/usr/local/protobuf-2.4.1 CXXFLAGS=-fPIC LDFLAGS=-fPIC d) 开源的C/C++库源代码包文件一般都采用类似于protobuf-2.4.1.tar.gz的命名方式 【推荐的编译环境目录结构】 假设有一项目mooon,它的目录结构如下,和SVN目录结构保持一致,但SVN上不存放中间目录和文件,mooon本身可以基于用户主目录,或者其它合适的目录,如/data目录下: mooon |-- doc |-- src `-- thirdparty |-- apr-util |-- boost |-- gflags |-- protobuf |-- sqlite |-- src_package | |-- apr-util-1.5.1.tar.gz | |-- boost_1_53_0.tar.gz | |-- cgicc-3.2.10.tar.gz | |-- gflags-2.0.tar.gz | |-- protobuf-2.4.1.tar.gz | |-- sqlite-autoconf-3071401.tar.gz | `-- thrift-0.9.0.tar.gz `-- thrift 安装openssl: # ./config --prefix=/usr/local/thirdparty/openssl-1.0.2a shared threads 安装httpd(apache),支持https: # ./configure --with-apr=/usr/local/thirdparty/apr-1.4.6 --with-apr-util=/usr/local/thirdparty/apr-util-1.5.1 --with-ssl=/usr/local/thirdparty/openssl-1.0.2a --with-pcre=/usr/local/thirdpar
一见
2018-08-10
1.9K
0
linux unzip: End-of-central-directory signature not found
其他
在linux上使用unzip解压一个.zip文件时,如果遇到下面这样的错误: Archive: common_library.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of common_library.zip or common_library.zip.zip, and cannot find common_library.zip.ZIP, period. 原因有两种: 1) 以ASCII格式上传了.zip文件 2) .zip文件大小超过了2G。
一见
2018-08-10
3.5K
0
C++资源编译工具,用于将任何格式的文件编译成C++代码
其他
resource_maker.zip linux自带了一个名叫xxd的工具,带参数-i运行时,效果类似,如:xxd -i /bin/ls。
一见
2018-08-10
1K
0
点击加载更多
社区活动
【纪录片】中国数据库前世今生
穿越半个世纪,探寻中国数据库50年的发展历程
立即查看
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档