- 博客(70)
- 收藏
- 关注
原创 centos7 配置iptables
yum install iptables-servicesfirewalld和iptables冲突,需要禁用firewalldsystemctl stop firewalldsystemctl disable firewalld启用iptablessystemctl enable iptablessystemctl start iptables保存修改后的iptablesiptab...
2019-01-09 17:19:05
234
原创 docker安装
docker在centos 7 的安装yum install yum-utils device-mapper-persistent-data lvm2yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoyum install docker-ces...
2019-01-09 16:58:18
203
原创 pgsql的高可用
pgsql的高可用1,共享磁盘主机故障,备机mount磁盘,提供服务2,主从模式主库传送archvelog 至从库,从库处于standby3,第三方软件
2019-01-04 18:15:55
722
原创 mysql的性能调优
mysql的性能调优分为以下几个部分:1,sql 调优2,index调优3,库表结构调优4,innodb调优5,执行计划调优6,buffer和cache调优7,lock调优8,mysql server调优操作系统调优io调优网络调优9,压力测试调优...
2019-01-04 18:15:14
509
原创 python中用list实现queue
python中用list实现queueclass myqueue(): def push(self,a): if self.count>=self.maxsize: print('The queue has been full!') return if self.max>=(self.maxsize-1): self.ma...
2019-01-04 16:45:11
2480
原创 python中判断质数
pyhton中判断质数def isprime(a): if isinstance(a,int)==False: return False if a<=1: return False if a==2: return True flag=1 x=int(pow(a,0.5))+1 for n in range(2,x): if a%n...
2019-01-04 16:44:51
2887
原创 pgsql数据备份和恢复
pgsql数据备份和恢复:1,sql dumppg_dump dbname > dumpfile恢复psql dbname < dumpfile备份db clusterpg_dumpall > dumpfile恢复psql -f dumpfile postgres2,文件系统备份shutdown db server备份文件系统
2019-01-04 16:44:24
3349
1
原创 mysql的多源复制
mysql 5.7 的multi-source replicationmysql复制分为基于binlog位置的复制和基于gtid的复制默认mysql会创建一个名为 ‘’ 的channel当开启multi-source replication的时候,在slave端需要进行以下设置:SET GLOBAL master_info_repository = ‘TABLE’;SET GLOBA...
2019-01-04 10:17:03
318
原创 pgsql客户端psql简介
psql使用:psql -hserver01 -p5432 [DBNAME [USERNAME]]? show help\q quit\l list databases\d list tables\c connect to new database
2019-01-03 17:54:55
1383
原创 pgsql监控
1,查看进程pgsql以多进程方式运行ps -ef|grep postgres2,查看进程活动情况select * from pg_stat_activity;select * from pg_stat_bgwriter;select * from pg_stat_archiver;select * from pg_stat_database;select * from pg...
2019-01-03 17:54:21
946
原创 pgsql配置简介
pgsql的配置文件1,postgresql.conf (控制数据库运行)data_directory =hba_file =listen_addresses =port =max_connections =shared_buffers =2,pg_hba.conf (控制用户访问权限)#TYPE DATABASE USER ADDRESS...
2019-01-03 17:53:47
467
原创 pgsql术语
1,database cluster:database cluster is a collection of databases2, Shared Memory and Semaphoressysctl -w kernel.shmmax=17179869184sysctl -w kernel.shmall=41943043,tablespace4,vacuum5,write ahea...
2019-01-03 17:53:19
186
原创 pgsql扩展模块
CREATE EXTENSION — install an extensionCREATE EXTENSION [ IF NOT EXISTS ] extension_name[ WITH ] [ SCHEMA schema_name ][ VERSION version ][ FROM old_version ][ CASCADE ]pg_available_extensionss...
2019-01-03 17:52:44
611
原创 mysql的profiling
mysql的profiling1,开启profileSET profiling = 1;2,查看共有多少querySHOW PROFILES;3, 查看具体某个query的信息:show profile for query n具体用法:SHOW PROFILE [type [, type] … ][FOR QUERY n][LIMIT row_count [OFFSET ...
2019-01-03 17:51:28
362
原创 mysql监控之show
mysql监控1,show status2,show master status3,show slave satus\G4,show plugins;5,show databases;6.show tables;7,show processlist;8,show profiles;9.show engines;10,show engine innodb status\G11,...
2019-01-03 17:51:04
176
原创 mysql监控之performance_schema
mysql中,perfomance_schma包含以下信息:usersthreadsmutex_instancesrwlock_instancesevents_waits_currentPerformance Schema 的配置信息存储在setup开头的表中:setup_actorssetup_consumerssetup_instrumentssetup_objectss...
2019-01-03 17:50:31
436
原创 python中利用list实现stack
class mystack():def _ _init(self)__:self.maxsize=5000self.max=-1self.l1=[]def setmaxsize(self,s):if isinstance(s,int)==False:print(‘your input is not a number!’)elif s<self.maxsize:print...
2019-01-03 08:41:37
958
原创 arangodb的graph之二
在arangodb中查询最短路径:FOR vertex[, edge]IN OUTBOUND|INBOUND|ANY SHORTEST_PATHstartVertex TO targetVertexGRAPH graphName[OPTIONS options]或FOR vertex[, edge]IN OUTBOUND|INBOUND|ANY SHORTEST_PATHstar...
2019-01-02 16:18:49
556
2
原创 pgsql 11.1安装
pgsql 11.1 安装1,下载并安装软件略2,准备创建用户useradd postgres创建目录mkdir /data/pgsqlchown postgres /data/pgsql3,初始化数据库/path/initdb -D /data/pgsql/data4,设置环境变量export PGDATA=/data/pgsql/dataexport LD_L...
2019-01-02 16:17:31
738
原创 python的class之二
python的类对象是指针测试如下:假设x为一个类的对象y=xx.a=10print(y.a)x.a=20print(y.a)输出为:1020可以看到x与y是同步更改的
2019-01-02 10:54:16
91
原创 将hive的metastore存储在mysql中
将hive的metastore存储在mysql中,需要做如下操作修改hive-site.xmlhive.metastore.localfalsejavax.jdo.option.ConnectionURLjdbc:mysql://server01:3306/hivedb?characterEncoding=UTF-8javax.jdo.option.ConnectionDri...
2019-01-02 09:43:43
399
原创 zookeeper配置
zookeeper配置zoo.cfg:dataDir=/data/zookeeperclientPort=2181server.1=server01:2888:3888server.2=server02:2888:3888server.3=server03:2888:3888
2019-01-02 09:21:29
96
原创 arangosh
/path/arangosh --server.endpoint tcp://127.0.0.1:8529 --server.database “_system” --server.username roothelpPredefined objects:arango: ArangoConnectiondb: ...
2019-01-02 09:02:06
503
原创 arangodb配置简介
arangodbd --configuration /etc/arangodb3/arangod.conf配置文件/etc/arangodb3/arangod.conf :directory = /data/arangodb3endpoint = tcp://0.0.0.0:8529storage-engine = autoauthentication = true...
2019-01-01 19:07:38
811
原创 mysql 5.7 group replication
group replication是主从关系,数据实时同步配置主节点my.cnf:server_id=1gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONl...
2019-01-01 17:38:17
281
原创 mysql中间件proxysql
proxysql有两个配置文件:1,proxysql.cnf配置说明:datadir="/data/proxysql"admin_variables={admin_credentials=“admin:admin”mysql_ifaces=“127.0.0.1:6032”}mysql_variables={interfaces=“0.0.0.0:6033”}2,proxy...
2019-01-01 17:00:38
123
原创 python的class之一
python的class定义:class ClassName:statement-1…statement-Nclass的初始化method: _ init() _当类对象被初始化时,会调用 _ init() _
2019-01-01 16:59:33
202
原创 mysql和性能相关的参数
mysql和性能相关的参数:innodb_buffer_pool_sizeinnodb_log_buffer_sizeinnodb_sort_buffer_sizejoin_buffer_sizekey_buffer_sizemyisam_sort_buffer_sizesort_buffer_sizebinlog_cache_sizequery_cache_typequery...
2019-01-01 16:35:16
364
原创 arangodb的graph之一
A Graph consists of vertices and edges.graph分为named graphs,anonymous graphsAQL Graph Operations 包含两种:AQL Traversals 遍历AQL Shortest Path 最短路径vertex,vertice,document是同义词edge,relation是同义词...
2019-01-01 16:31:05
637
1
原创 python中的lambda表达式
python中的lambda表达式,相当于一个小function,例如:f=lambda x:x+2等同于def f(x):return x+2
2019-01-01 14:56:12
868
原创 python中的list
python中的list实际是一个指针例如:l1=[1,2,3,4]l2=l1for n in range(0,len(l2)):l2[n]=n*nprint(l1)print(l2)输出结果为:[0, 1, 4, 9][0, 1, 4, 9]说明修改l2,会导致l1的值同步变化。因为两个指针指向的是同一份数据在function中,如果传递list作为参数,在functio...
2019-01-01 14:03:07
298
原创 mysql中间件dbproxy安装
dbproxy安装需要注意以下几点:1,需要glib-2.42有可能需要自行下载安装2,编译的时候如果报错需要设置 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2018-12-31 13:20:27
828
原创 mysql参数secure_file_priv
secure_file_priv 是一个和安全相关的参数初始时最好设为空secure_file_priv=“”详细说明:This variable is used to limit the effect of data import and export operations, such as those performed by the LOAD DATA and SELECT … IN...
2018-12-31 11:36:50
1097
原创 mongodb的备份
1,使用mongodump当数据库较小时,使用mongodump备份,使用mongorestore恢复2,冷备份停止数据库,copy,启动数据库3,热备journal处于enable状态,disable balancer,备份文件系统,enable balancer...
2018-12-31 11:35:40
114
原创 percona server的并行复制
设置以下参数slave_parallel_typeslave_parallel_workers5.7 has two slave_parallel_type:DATABASELOGICAL_CLOCKslave_parallel_workers = N (N>1)5.6 slave_parallel_type:DATABASE
2018-12-31 11:34:58
166
原创 percona server的线程池
设置以下参数:thread_handling可选两个设置:one-thread-per-connectionpool-of-threads
2018-12-31 11:34:06
410
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人