linux
未读安装zabbix-server
下载安装123456wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.10/zabbix-3.0.10.tar.gz# tar包含 Server, Proxy, Agent, GUItar -zxvf zabbix-3.0.10.tar.gzcd zabbix-3.0.10./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2makemake install
相关依赖
未提示错误此步骤可以跳过1234 yum -y install net-snmp net-snmp-devel curl curl-devel libxml2 libxml2-devel# zabbix server有图形化要求,需要借助PHP gd的支持,这两项是PHP gd的必须项- freetype- ...
error_reporting
规定不同的错误级别报告:
error_reporting(level);
level 可选。规定新的 error_reporting 级别。可以是一个位掩码也可以是一个已命名的常量。注释:强烈建议使用已命名的常量,以确保兼容将来的版本。由于错误级别的添加、整数取值范围的增加,较久的基于整数的错误级别不会总是和预期的表现一致。可用的错误级别常量及其实际含义描述在了 predefined constants 中。123456789101112131415<?php // 关闭错误报告 error_reporting(0); // 报告 runtime 错误 error_reporting(E_ERROR | E_WARNING | E_PARSE); // 报告所有错误 error_reporting(E_ALL); // 等同 error_reporting(E_ALL); ini_set("error_reporting", E_ALL); // 报告 E_NOTICE 之外的所有错误 error_reporting(E_ ...
安装goAccess日志分析工具123456$ wget http://tar.goaccess.io/goaccess-1.2.tar.gz$ tar -xzvf goaccess-1.2.tar.gz$ cd goaccess-1.2/$ ./configure --enable-utf8 --enable-geoip=legacy$ make# make install
如果出现错误configure: error: *** Missing development files for the GeoIP library
解决办法123yum install GeoIP-develyum install php-pearyum install php-pecl-geoip
再重新配置 -> 编译 ->安装
测试日志分析1goaccess -f time_access.log -a > report.html
错误提示123Fatal error has occurredError occured at: src/parser.c - verify_formats ...
linux
未读git 指定ssh key 解决多个ssh sky的问题
git 默认使用key~/.ssh/id_rsa.pub 但是如果有个项目不走这个key,另外走一个key可以如下配置
生成一个新的key1234ssh-keygen -t rsa -f ~/.ssh/id_rsa_newkey -C "email" //id_rsa_newkey 新key文件名 email 配置邮箱地址//直接回车及生成新key//查看ls -la ~/.ssh/
配置git用户名项目所需使用key1vi ~/.ssh/config
加入配置参数123Host git.oschina.net //如oschina git域名 IdentityFile ~/.ssh/.id_rsa_newkey User xxx@qq.com
git项目或者git用户中加入公钥key12cat ~/.ssh/.id_rsa_newkey.pub//复制key 加入自己账户或项目ssh中
测试ssh key是否配置成功123ssh -T git@git.oschina.net //git@域 ...
nsq简介
nsq主要有三个主要程序和一个web服务程序
1、nsqd:守护进程,接收、缓存,并投递消息给客户端。
2、nsqlookupd:守护进程,为消费者提供运行时发现服务,来查找制定话题(topic)的生产者nsqd
3、nsq_to_http:消费制定的话题(topic) / 通道(channel) 和执行HTTP requests(get/post)到制定的断点。
4、nsqadmin:是web服务,来实时的管理nsq集群,通过nsqlookupd实例交流,来确定生产者
简易上手操作
安装 install
启动nsqlookupd12//命令行执行nsqlookupd
启动nsqd12//再启一个命令窗口执行nsqd --lookupd-tcp-address=127.0.0.1:4160
启动nsqadmin12//再启一个命令窗口执行nsqadmin --lookupd-http-address=127.0.0.1:4161
发布初始消息(也在集群中创建主题)1curl -d 'hello world 1' 'ht ...
rabbitMQ mac下安装运行配置
安装12wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.3/rabbitmq-server-mac-standalone-3.5.3.tar.gztar -zxvf rabbitmq-server-mac-standalone-3.5.3.tar.gz
运行1./sbin/rabbitmq-server
使用rabbitMQ管理页面,Ctrl+C退出刚刚启动进程12/rabbitmq-plugins enable rabbitmq_management //允许后台管理./sbin/rabbitmq-server //再次启动服务
后台测试 地址 http://localhost:15672/ 用户名和密码 是 guest/guest
php测试发送接收
创建一个目录php进入 composer init初始化composer
composer.json引入扩展123"require": { "php-amqpli ...
安装zookeeper
安装kafka前需要先安装zookeeper
安装步骤
下载wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
解压 tar -zxvf zookeeper-3.4.6.tar.gz
配置1234cd zookeeper-3.4.6cp -rf conf/zoo_sample.cfg conf/zoo.cfgvim zoo.cfg
12345678910111213141516171819202122232425262728# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial# synchronization phase can takeinitLimit=10# The number of ticks that can pass between# sending a request and getting a ...
sphinx 安装123456wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gztar xzvf sphinx-0.9.9.tar.gzcd sphinx-0.9.9./configure --prefix=/usr/local/sphinx/ --with-mysql --enable-id64makemake install
安装coreseek 前
因为coreseek需要autoconf 2.64以上版本,因此需要升级autoconf,不然会报错。从http://download.chinaunix.net/download.php?id=29328&ResourceID=648下载autoconf-2.64.tar.bz2,安装方法如下:12345tar -jxvf autoconf-2.64.tar.bz2cd autoconf-2.64./configuremakemake install
安装coreseek12345678#安装mmseg(coreseek所使用的词典)wg ...
mysql
未读
title : 开启mysql慢查询日志category :mysqltag : mysql开启mysql慢查询日志
slow_query_log :是否开启慢查询日志,1表示开启,0表示关闭。
log-slow-queries 5.6版本以下 慢日志路径
slow-query-log-file 5.6 版本以上 慢日志路径
long_query_time :慢查询阈值,当查询时间多于设定的阈值时,记录日志。
log_queries_not_using_indexes:未使用索引的查询也被记录到慢查询日志中(可选项)
log_output:日志存储方式 log_output=’FILE’表示将日志存入文件,默认值是’FILE’ log_output=’TABLE’表示将日志存入数据库
修改my.cnf文件
1234low_query_log =1 //开启慢查询日志日志 1开启/0关闭long_query_time=0.2 慢查询时间slow_query_log_file=/data/server/mysql/data/mys ...
linux
未读circusctl入坑故障排错circus介绍
circus是一个进程管理工具,类似于supervisod。
安装1pip install circus
启动1circusd --log-level debug ./circus.ini
配置自己的ini文件时多使用debug调试,即时发现问题,这里可能不仅仅会出现circusd的报错,会有会第三方依赖包的问题,细节注意报错内容,如果是第三方包有问题,及时卸载重装尝试解决。
这里折腾了很久,最终发现tornado有问题,卸载重装解决1sudo pip install tornado==4.5.2
项目管理
查看运行状态1circusctl status
启动/停止/重启1circusctl restart proj