Old GC:只收集old gen的GC。只有CMS的concurrent collection是这个模式
Mixed GC:收集整个young gen以及部分old gen的GC。只有G1有这个模式
Full GC:收集整个堆,包括young gen、old gen、perm gen(如果存在的话)等所有部分的模式。
Major GC通常是跟full GC是等价的,收集整个GC堆。但因为HotSpot VM发展了这么多年,外界对各种名词的解读已经完全混乱了,当有人说“major GC”的时候一定要问清楚他想要指的是上面的full GC还是old GC。
关于GC的时机是这样触发:
young gc :也就是常说的 minor gc,会在 young gen 的 eden 区满了触发,也就是剩余空间不足以加载新对象时
full gc :
serial GC:
在 serial GC 实现中,在触发一次 young gc 之前,会根据历史GC统计数据,计算之前平均每次 young gc 晋升到 old gen 的对象大小,当 old gen 剩余空间比这个平均值小时,会进行一次 full gc 。(此时会取消这次 young gc,因为除了 CMS 的并发GC,大多数的 full gc 包含了对 young gen 以及其他的堆空间的 gc。)
在 perm gen 没有足够空间时
执行 System.gc()时,根据资料这个命令是建议JVM执行GC,而不是一定会执行。
heap dump带GC。
Parallel Scavenge 框架下,执行full GC 之前会触发一次 young GC,以让程序在两次GC之间可以运行一下下,减少 full GC 的暂停时间,减少了 full GC的工作量。
并发GC:以CMS为例子,定时检查 old gen 的使用量,超过了一定比例就进行一次 CMS GC。可以根据-XX:CMSInitiatingOccupancyFraction 设置比例,以及设置-XX:+UseCMSInitiatingOccupancyOnly设置仅超过比例GC,不然可能会在低于这个比例时也进行GC。
ElasticSearch的索引即index,可以理解为MySQL的 Table (6.x之前可以理解为database, 6.x之后可理解为table)。因为之前在 index 和文档之间有一层 type(类型),且可以创建多个mapping,而7.0没有了,一个 index 也只能有一个 mapping。
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
[2020-02-13 20:14:49] [INFO] checking state of node 1, 6 of 6 attempts [2020-02-13 20:14:49] [WARNING] unable to ping "user=postgres password=d connect_timeout=2 dbname=postgres host=db1 fallback_application_name=repmgr" [2020-02-13 20:14:49] [DETAIL] PQping() returned "PQPING_NO_RESPONSE" [2020-02-13 20:14:49] [WARNING] unable to reconnect to node 1 after 6 attempts [2020-02-13 20:14:49] [INFO] 0 active sibling nodes registered [2020-02-13 20:14:49] [INFO] primary and this node have the same location ("default") [2020-02-13 20:14:49] [INFO] no other sibling nodes - we win by default [2020-02-13 20:14:49] [NOTICE] this node is the only available candidate and will now promote itself [2020-02-13 20:14:49] [INFO] promote_command is: "/usr/lib/postgresql/9.5/bin/repmgr standby promote -f /etc/postgresql/repmgr.conf --log-to-file" [2020-02-13 20:14:49] [NOTICE] promoting standby to primary [2020-02-13 20:14:49] [DETAIL] promoting server "139" (ID: 2) using "/usr/lib/postgresql/9.5/bin/pg_ctl -w -D '/var/lib/postgresql/9.5/main' promote" LOG: received promote request [2020-02-13 20:14:49] [NOTICE] LOG: redo done at 0/5000028 waiting up to 60 seconds (parameter "promote_check_timeout") for promotion to complete LOG: last completed transaction was at log time 2020-02-13 04:13:29.417036-08 LOG: selected new timeline ID: 2 LOG: archive recovery complete LOG: MultiXact member wraparound protections are now enabled LOG: database system is ready to accept connections LOG: autovacuum launcher started [2020-02-13 20:14:50] [NOTICE] STANDBY PROMOTE successful [2020-02-13 20:14:50] [DETAIL] server "139" (ID: 2) was successfully promoted to primary [2020-02-13 20:14:50] [INFO] 0 followers to notify [2020-02-13 20:14:50] [INFO] switching to primary monitoring mode [2020-02-13 20:14:50] [NOTICE] monitoring cluster primary "139" (ID: 2)
apt 安装后并配置数据库会导致启动数据库时could not access file “repmgr”: No such file or directory It means the repmgr extension code is not installed in the PostgreSQL application directory. This typically happens when using PostgreSQL packages provided by a third-party vendor, which often have different filesystem layouts.
Either use PostgreSQL packages provided by the community or 2ndQuadrant; if this is not possible, contact your vendor for assistance. 简单就是说用的可能时第三方的包,还是从官网下载包并编译安装吧。
提示未输入密码
1 2 3 4 5 6
ERROR: connection to database failed DETAIL: fe_sendauth: no password supplied
ERROR: unable to establish necessary replication connections HINT: check replication permissions on the source server
apt install postgresql-server-dev-9.5 # 安装插件前需要安装 pg-dev ./configure --prefix=/opt/pgpool make make install
–prefix 为安装后的目录前缀,也就是根目录 若出现 configure 错误 checking for PQexecPrepared in -lpq… no configure: error: libpq is not installed or libpq is old 是由于找不到 pg lib 库,可添加参数-with-pgsql=pgsql lib路径。 安装后如果找不到命令,要么进入 /opt/pgpool/bin 执行。 推荐引入环境变量, /etc/profile
进入解压后的目录,安装相关函数。 比如:/home/d/pgpool-II-3.7.12/src/sql。 分别进入pgpool_adm,pgpool-recovery,pgpool-regclass文件夹,进行 make & make install。 检查: 进入/usr/share/postgresql/9.5/extension目录,查看是否有相关函数文件。
#------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------
failover_command:故障转义命令。 部分参数如下: # Executes this command at failover # Special values: # %d = node id # %h = host name # %p = port number # %D = database cluster path # %m = new master node id # %H = hostname of the new master node # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %% = '%' character
pgpool stop 停止很久但是无法关闭。 在具有浮点IP的机器上关闭 pgpool 很久还是没有关闭。发现有一个原因是因为连接没有关闭,但是有时候连接关闭了,还添加了 -m fast 参数还是无法关闭。还未找到原因。 经过配置发现 开启 watchdog 会导致此问题。use_watchdog = off 则不会 提示如下。
1 2 3 4 5 6 7 8 9 10 11
2020-02-10 01:25:38: pid 28280: LOG: Watchdog is shutting down 2020-02-10 01:25:38: pid 28280: LOG: waiting for escalation process to exit before starting de-escalation 2020-02-10 01:25:39: pid 28280: LOG: waiting for escalation process to exit before starting de-escalation 2020-02-10 01:25:40: pid 28280: LOG: waiting for escalation process to exit before starting de-escalation 2020-02-10 01:25:41: pid 28280: LOG: waiting for escalation process to exit before starting de-escalation 2020-02-10 01:25:42: pid 28280: LOG: waiting for escalation process to exit before starting de-escalation 2020-02-10 01:25:43: pid 28280: LOG: escalation process does not exited in time 2020-02-10 01:25:43: pid 28280: DETAIL: starting the de-escalation anyway 2020-02-10 01:25:43: pid 40639: LOG: watchdog: de-escalation started 2020-02-10 01:25:43: pid 40639: LOG: successfully released the delegate IP:"192.168.56.122" 2020-02-10 01:25:43: pid 40639: DETAIL: 'if_down_cmd' returned with success