自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

hello congshen

自我成长

  • 博客(98)
  • 资源 (1)
  • 收藏
  • 关注

原创 3年DBA之路

一、写在开头 今年4月是我正式参与工作满三年的句号,我觉得有必要回顾一下过去三年DBA生涯的工作经历,帮助自己做好总结,并想清楚自己未来要走的路。同时也希望这些经历能帮到别人。 毕业时候参加过数据开发、游戏研发以及DBA的实习,或许是因为我当时感觉DBA的职业特性跟我性格比较匹配的缘故吧,最终我选择了DBA作为我第一份正式职业。 当时的我对DBA的了解十分有限,甚至此前都没有接触过DBA,对数据库的了解也仅限于使用。所以这3年我也是在工作中不断地摸索和学习,接下来是从我的视角来...

2020-05-15 21:16:25 631 1

原创 没有netstat情况下解析网络连接

无netstat网络查询

2024-03-07 15:50:51 386

原创 【Redis】Redis内存分析

一、简述 在Redis实际运行维护和参数优化的时候,往往需要对Redis内存使用情况进行详细地分析,仅依靠Redis的info功能是远远达不到需求的。 为了能够详细地了解到Redis服务中具体的key以及key所占用的空间大小、元素数量、底层编码等信息,我们需要使用第三方工具:redis-rdb-tools。该工具通过解析rdb文件,能够分析出实例内存的详细情况。二、redis-rdb-tools简介redis-rdb-tools是开源的工具Github地址:https://...

2020-06-25 01:22:31 653

原创 【Redis】Redis实例迁移中的防火墙权限迁移实现

一、简述 由于大多数情况下Redis的部署都是单机多实例,且Redis的权限目前仅iptables控制,在进行实例迁移的时候,就不能将整个iptables文件copy过去,需要截取该实例端口开通的权限到目标服务器上。二、实现方式 1、通过ansible获取shell模块执行grep命令获取到源实例相关防火墙权限内容; 2、将防火墙内容写入到中控端临时文件中; 3、通过ansible的copy模块将权限内容的临时文件传到目标服务器; 4、通过ansi...

2020-06-23 16:53:08 284

原创 【consul】consul的锁应用

list前言我的使用场景及使用方式简介存在的问题正确的使用前言在建设数据库高可用的时候,采用了consul的机制实现,在开发相关组件的时候,使用了consul的锁机制。但是由于使用的不正确,带来了一些问题,下面主要介绍我的使用场景及使用方式,出现的问题,以及正确的使用方法。我的使用场景及使用方式简介在进行数据库高可用的选举组件设计时,考虑使用consul的锁来进行consul-server的选举,谁先获取到锁,谁就成为consul-server的leader,由leader实施数据库选主。组件开发

2020-06-09 00:28:55 609

原创 【python】封装自己的日志书写器

# encoding: utf-8import sysimport loggingfrom logging.handlers import RotatingFileHandlerclass MYLogger(object): level_relations = { 'debug':logging.DEBUG, 'info':logging.INF...

2020-05-12 16:58:28 484 1

原创 OpenTSDB常用接口使用DEMO(查询)

一、说明OpenTSDB的写入目前有OpenTSDB开源的tcollector采集框架,所以不着重去写关于写入的接口说明,这里主要是介绍常用的读取接口,便于对监控数据进行一些定制化检查、统计。二、常用接口OpenTSDB地址:192.168.180.128:16002*1、查询所有的metric*http://192.168.180.128:16002/api/suggest?max=1000&q=&type=metrics返回["...

2020-05-09 16:44:45 1261

原创 OpenTSDB接口使用简介

一、简介 OpenTSDB提供基于HTTP的接口,以实现与外部系统的集成。 几乎所有OpenTSDB功能都可通过API访问,例如查询时间序列数据,管理元数据和存储数据点。 在使用各个接口之前,需要阅读相关API文档。 目前OpenTSDB已经与很多开源的监控系统集成,这种情况下,对OpenTSDB的接口就相对简单些,只需要掌握一些相对固定的查询接口就可以实现来巡检、自定制可视化界面的功能。 但如果是自行开发可视化界面和监控报警功能,就需要深入掌握OpenTSDB接口的请求方法和...

2020-05-09 16:34:32 1213

原创 【Redis】关于zrevrangebyscore获取zset数据出现member缺失、重复的问题

1、问题描述有一个存储Zset,Score是时间戳,Member是结构体,选择(ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]),count取值是30。 这个Zset中的数目比较多,13w多,昨天结果验证发现,有一个数据丢失了,有两个数据被重复选择。2、key结构及操作模型Key:userbirthtsScore...

2020-04-22 11:31:23 2518

原创 Codis学习(一)——初识

Codis是一个用Go编写的分布式、高性能Redis集群解决方案。并且已投入生产,广泛应用于许多公司。对于上层的应用来说, 连接到 Codis Proxy 和连接原生的 Redis Server 没有显著区别 (除了部分codis不支持的命令外), 上层应用可以像使用单机的 Redis 一样使用, Codis 底层会处理请求的转发, 不停机的数据迁移等工作, 所有后边的一切事情, 对于前面的客户...

2020-04-10 16:44:36 428

原创 Redis运维实践(二)——python多线程方式快速遍历集群

Redis单实例的遍历我们都知道,使用scan就可以了。但是对于集群,遍历功能的支持就不是这么友好了,所以本次我就想到用单实例scan+多线程的形式去实现集群的快速遍历。今日内容预览scan功能简介python多线程简介scan+多线程集群遍历实现scan功能简介redis全库遍历key使用的是keys 命令,而keys命令会造成阻塞,所以出现了scan增量式迭代的命令来支持...

2020-04-10 16:42:01 738

原创 Redis运维实践(一)——pipeline批量数据导入

Redis批量数据导入的方式很多,可以通过python脚本解析文本并使用pipeline批量命令的方式实现,也可以通过批量命令文本+pipeline的形式。内容预览* pipeline简介* pipeline批量数据导入pipeline简介Redis是一种基于客户端-服务端模型以及请求/响应协议的TCP服务。这意味着通常情况下一个请求会遵循以下步骤:1、客户端向服务端发送一个查...

2020-04-10 16:33:45 820

原创 【SSDB】【python】删除千万级zset大key

背景最近接到需求,要删除ssdb中一个8000+w个member的zset。该SSDB架构为双主模式+Keepalived构建的高可用。处理时长要求在一天内完成。相关SSDB-APIzrange:zrange name offset limit,根据下标索引区间 [offset, offset + limit) 获取 key-score 对, 下标从 0 开始. zrrange 是反...

2020-04-03 12:01:42 1250

原创 关于监控系统的一些想法心得

后续会把一些部署、测试以及经验都写到博客里…我上一篇文章里写过的kairosdb,那是我开始接触监控系统的第一步,它帮助我了解了时序数据库在监控端的优秀表现。 kairosdb算是相当优秀的监控系统存储后端,并且支持使用grafana(一款可视化效果极佳的数据可视化软件)作为数据展示端。同时也支持使用Tcollector(openTSDB专用的数据采集工具,集成了大量的数据采集脚本,覆盖面很广泛)

2017-08-14 20:37:58 1529

原创 kairosDB

kairosDB持续更新中…最近工作需要开始接触kairosDB,其github网址为:[http://kairosdb.github.io/][6],在此我会在这记录一些操作与分享经验。 经过近大半个月的学习,基本的功能已经掌握,这几天会将这篇东西完成。 下面是我的环境说明使用VMware上安装的Ubuntu操作系统**因为才刚刚开始,所以内容会有些凌乱,随着研究深入会逐渐修改...

2017-01-11 18:02:14 9507 1

原创 linux常用指令及使用心得(保持更新)

实习后台开发的过程,需要用到linux进行开发,这里收录一下我工作中常用的指令,以及工作中的一些技术总结。1、常用简单指令ssh 命令用于远程登录上Linux主机,常用格式:ssh [-l login_name] [-p port] [user@]hostname如: ssh [email protected]   或    ssh [email protected]  有域名的参

2016-10-23 00:20:54 465

原创 mysql常用指令及使用心得(保持更新。。。)

最近开始实习,要用到mysql的东西,这里记录下我工作经常需要用到的东西。Mysql 登陆mysql -h127.0.0.1 -uroot -proot test   //其中-h后接ip目标机器地址(一般本机都是127.0.0.1,当然本地的话一般不用写ip),-u后接用户名,-p接密码(如果只写-p的话,下面指令输出之后会提示输入密码),最后接库名(如果没写库名,则默认连到机子

2016-10-22 17:58:25 375

原创 [leetcode] 【位运算】 371. Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.题意就是不用+ -号进行求和运算。题解先看位运算的两个符号:一个是异或(^)  1^1=0

2016-08-20 11:35:02 286

原创 [unity] unity学习——滚球游戏

一、学习内容滚球游戏是这样的,一个四面有墙的场景,里面有球和小方块,控制球去吃方块,吃完方块就游戏结束。通过制作滚球游戏进一步熟悉unity的操作以及游戏元素的设计。二、游戏制作过程1、创建3D工程——Roll a Ball2、保存游戏场景file——save scence,保存游戏场景,保存在工程目录的_scence目录中,命名为minigame3、创

2016-07-01 19:46:49 15779 1

原创 [unity] unity学习——弹球游戏

一、学习内容通过弹球游戏,来熟悉unity的简单操作,以及一些脚本的添加及控制。弹球游戏:  即只有一个底盘和一个球,控制底盘去接球,球撞到底盘后随机一个角度反弹。没接住球就算结束。二、弹球游戏的制作1、打开unity5,新建一个3d工程。2、在Hierarchy视图框中添加一个cube对象,并命名Plate,作为底盘:这个对象的Inspector视图的Transfor

2016-06-30 22:48:34 12213 2

原创 [leetcode] 【查找】 74. Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each

2016-06-21 15:07:01 244

原创 [leetcode] 【查找】 35. Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-06-21 11:24:32 227

原创 [leetcode] 【查找】 34. Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found

2016-06-21 09:33:42 216

原创 [leetcode] 【分治法】 69. Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x.题意实现平方根函数,返回x的根。题解二分法,取到合适的数为止。class Solution {public: int mySqrt(int x) { if(x<2) return x; double

2016-06-21 00:39:50 376

原创 [leetcode] 【分治法】 50. Pow(x, n)

Implement pow(x, n).题意实现幂函数。题解使用分治法求解。分:将n分成n/2  直到n=0时,返回1;治:对n为偶数,返回两数相乘的结果,奇数再乘多一个x; class Solution {public: double myPow(double x, int n) { if(n<0) return 1/power(x,-n

2016-06-21 00:37:26 552

原创 [leetcode] 【排序】 75. Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers

2016-06-20 19:00:36 215

原创 [leetcode] 【排序】 41. First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant

2016-06-20 18:12:18 228

原创 [leetcode] 【排序】 148. Sort List

Sort a linked list in O(n log n) time using constant space complexity.题意对链表进行排序,时间复杂度O(n log n),空间复杂度为常数。题解可

2016-06-20 13:20:20 185

原创 [leetcode] 【排序】 147. Insertion Sort List

Sort a linked list using insertion sort.题意用插入排序算法为链表排序。题解遍历原链表的每个元素,每个元素都有在新链表中从头往后找适合其的位置,然后插入。/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode

2016-06-20 13:00:07 221

原创 [leetcode] 【排序】 23. Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.题意合并k个排好序的链表,并返回这个排好序的链表。题解两个两个合并,即复用[leetcode] 【排序】 21. Merge Two Sorted Lists这题的函数。/**

2016-06-20 12:46:13 242

原创 [leetcode] 【排序】 21. Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.题意合并两个链表,新的链表由两个链表的节点组成。题解和归并类似,一步步取两条链最小那个节点即可。

2016-06-20 12:11:19 220

原创 [leetcode] 【排序】 88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add

2016-06-20 11:56:10 185

原创 [leetcode] 【栈】150. Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1"

2016-06-16 18:54:18 176

原创 [leetcode] 【栈】 84. Largest Rectangle in Histogram

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width o

2016-06-16 16:48:59 176

原创 [leetcode] 【栈】 32. Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()",

2016-06-16 16:08:25 240

原创 [leetcode] 【栈】 20. Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va

2016-06-16 15:56:00 180

原创 [leetcode] 【字符串】58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is

2016-06-15 22:07:57 212

原创 [leetcode] 【字符串】71. Simplify Path

Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"Corner Cases:Did you consider the case where p

2016-06-15 16:50:47 200

原创 [leetcode] 【字符串】 49. Group Anagrams

Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note: Al

2016-06-15 16:47:55 289

原创 [leetcode] 【字符串】 38. Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as 

2016-06-15 15:53:46 238

java中文api

中文版java API,不谢

2016-03-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除