Skip to content

Instantly share code, notes, and snippets.

View leapar's full-sized avatar

leapar leapar

  • 江西-南昌
View GitHub Profile
import _hashlib

def _reset_sys_path():
    # Clear generic sys.path[0]
    import sys, os
    resources = "/opt/datadog-agent-o/Datadog Agent.app/Contents/Resources/"
    while sys.path[0] == resources:
        del sys.path[0]

同事的内部分享, 个人觉得可以分享给大家,我很久前自己有个人部署和学习了解过zookeeper,但没太认真研究和思考,我知道,有机会,肯定还需要进一步学习zookeeper的

  1. 序言
  2. 目录规划
  3. 安装步骤 3.1 下载和解压 3.3 日志格式 3.4 配置文件 3.5 部署Zookeeper Server服务标识
  4. 启动和关闭
@leapar
leapar / hbase.html
Created February 21, 2017 11:25
HBase随机宕机事件处理 & JVM GC回顾
一、引言
本文记录了困扰团队两周的HBase随机宕机事件的解决方案,并回顾了JVM GC调优基础知识,供各位参考。
欢迎转载,请注明出处:
http://blog.csdn.net/u010967382/article/details/42394031
二、实验环境
16台虚拟机,每台4G内存,1核CPU,400G硬盘
Ubuntu 14.04 LTS (GNU/Linux 3.13.0-29-generic x86_64)
CDH5.2.0套装(包括相应版本的Hadoop,HIVE,Hbase,Mahout,Sqoop,Zookeeper等)
Java 1.7.0_60 64-Bit Server
三、异常现场
@leapar
leapar / gist:9a27d23333123903aae64781abbfec11
Last active February 9, 2017 08:44
http-proxy 请求进行多服务器分发

客户端发送http请求,后端进行多个服务器转发。本例转发了3个服务器。

var https = require('https');
var httpProxy = require('http-proxy');
var http = require('http');

httpProxy.createProxyServer({
  target: 'https://app.datadoghq.com',
  agent: https.globalAgent,
@leapar
leapar / docker.md
Last active June 12, 2017 03:05
docker
  1. docker ps -a
  2. docker images
  3. docker build -t tag --no-cache
  4. docker run -i -t tag /bin/bash
  5. docker cp containerid:/path localpath
  6. docker save imageid > local.tar
  7. docker load < local.tar
  8. docker rm containerid
  9. docker rmi imageid
@leapar
leapar / dd-agent.md
Created November 23, 2016 06:57
Windows packing dd-agent

Windows

Currently tested with 32-bits python and other tools

  • install windows
  • install git
  • clone sts-agent
  • run in administrator powershell: Set-ExecutionPolicy -ExecutionPolicy Unrestricted
  • python 2.7
@leapar
leapar / py2exe.md
Last active November 23, 2016 05:59
py2exe service

py2exe打包dd-agent时候,ddagent.exe一直报不支持--multiingprocess-fork,最后发现需要修改 D:\Python27\Lib\site-packages\win32\lib\win32serviceutil.py行526

def HandleCommandLine(cls, serviceClassString = None, argv = None, customInstallOptions = "", customOptionHandler = None):
    """Utility function allowing services to process the command line.

    Allows standard commands such as 'start', 'stop', 'debug', 'install' etc.

 Install supports 'standard' command line options prefixed with '--', such as