Tbase 源码 (一)

腾讯云TBase分布式数据库安装部署 1、在腾讯云申请两台CVM虚机。 配置:4core 8gmem 配置:虚机SG安全组 2、修改主机名 hostnamectl set-hostname tbase1 hostnamectl set-hostname tbase2 vim /etc/hosts 172.17.0.11 tbase1 172.17.0.14 tbase2 3、下载安装包 wget https://tbase-4434423233434333.cos.ap-shanghai.myqcloud.co... 阅读详情

     TBase 是基于Postgres-XL 开源项目,演进优化发展而来的 企业级分布式并行计算开源数据库。

TBase is an advanced enterprise-level database management system based on prior work of Postgres-XL project. It supports an extended subset of the SQL standard, including transactions, foreign keys, user-defined types and functions. Additional, it adds parallel computing, security, management, audit and other functions.

  Postgres-XL 10R1.1 版本发布后(2019-02-18),后续 停止新版本发布。

Postgres-XL官方网站  Postgres-XL | Open Source Scalable SQL Database Cluster

 Postgres-XL 10R1.1 now available! Click here to download the source tarball. (2019-02-18)

TBase是一个提供写可靠性,多主节点数据同步的关系数据库集群平台。你可以将TBase配置一台或者多台主机上,TBase数据存储在多台物理主机上面。数据表的存储有两种方式, 分别是distributed或者replicated ,当向TBase发送查询 SQL时,TBase会自动向数据节点发出查询语句并获取最终结果。

TBase采用分布式集群架构 , 该架构分布式为无共享(share nothing)模式,节点之间相应独立,各自处理自己的数据,处理后的结果可能向上层汇总或在节点间流转,各处理单元之间通过网络协议进行通信,并行处理和扩展能力更好,这也意味着只需要简单的x86服务器就可以部署TBase数据库集群。

解读一下TBase的三大模块

  • Coordinator:协调节点(简称CN)

    业务访问入口,负责数据的分发和查询规划,多个节点位置对等,每个节点都提供相同的数据库视图;在功能上CN上只存储系统的全局元数据,并不存储实际的业务数据。

    CN是应用 SQL 的入口,完全无状态。一条 SQL 进来,走的是这条流水线:

    前端协议层 → SQL解析 → 优化 → 路由 → 执行 → 后端协议层

    "无状态"这三个字是 CN 设计的灵魂,直接带来三个好处:

    1、随便加机器,加一台就加一份并发处理能力,水平扩展天然支持;

    2、挂了不丢数据 ——数据都在 DN 上,CN 重连就行;

    3、读写分离、负载均衡都在这层做,对应用透明。

     本质上 CN 就是个无状态的 SQL 网关 + 优化器。

  • Datanode:数据节点(简称DN)

    每个节点还存储业务数据的分片在功能上,DN节点负责完成执行协调节点分发的执行请求。

    数据的最终归宿,业务数据水平切分后散落在多个 DN 上。多个 DN 组成安全分片组(DBGroup)——一组里一个 Master 加一个或多个 Slave,主备之间wal 同步走的是物理复制槽。

    DN 内部是标准数据库内核那套:连接器(认证)→ 分析器(解析)→ 优化器(计划)→ 执行器 → 数据文件(B+ 树组织表)。 每个 DN 本质上就是一个独立的数据库实例。

    SQL 语法:DDL/DML/DQL 全套  、窗口函数等

    字符集:utf8 、gbk 

    对象:视图、分区、存储过程、自定义函数、触发器

    唯一要适应的是建表多了个DISTRIBUTED BY子句,用来指定分片策略

  • GTM:全局事务管理器(Global Transaction Manager)

    负责管理集群事务信息,同时管理集群的全局对象,比如序列等。

    GTM 分布式一致性的核心,主备多机部署。它内部有五个模块:

    GTID 模块 —— 全局事务 ID 的申请/释放,保证事务标识全局唯一

    SEQUENCE 模块 —— 全局序列取值(就是seq.nextval那种)

    CTID 模块 —— 分布式事务的提交顺序 ID,管全局提交先后

    持久化模块 —— GTID、SEQUENCE 落盘,防宕机丢

Q:支持行列混合存储吗?

A:开发的V3版本是支持的,目前开源的V2版本是只支持行存。

Q:扩容后老数据如何清理?

A:我们现在扩容的老数据更多的是通过delete+vacuum的方式做数据的清理,因此老数据清理会对业务造成一些影响。后面会有一些更好的方式来做,比如说做一些数据聚簇的方案,来优化扩容的搬迁和扩容的数据清理对系统的一些影响。

Q :索引膨胀如何解决?

A:若你更新数据或者数据搬迁确实会有索引膨胀,我们建议是重建索引。因为索引重建是可以并行来做的,对业务其实是没有太大的影响,索引建好后把老的索引删掉就OK了。

 ++++++++++++++++++++++++++++++++++++++++++++

===Tbase ===   源码

【语义分析】部分 沿用了PostgreSQL的源码。

 【查询重写】部分依然沿用PostgreSQL的源码\src\backend\tcop\Postgres.c,入口函数是:pg_rewrite_query 。

 

【查询优化——预处理】查询优化模块的入口函数是pg_plan_queries函数 \src\backend\tcop\Postgres.c,它负责将查询树链表变成执行计划链表。

Utility commands  不需要执行计划

/* Utility commands require no planning. */

  CMD_UTILITY,                /* cmds like create, destroy, copy, vacuum,
                                 * etc. */

非 Utility commands,

//调用优化器 planner函数

plan = planner(querytree, cursorOptions, boundParams);
/*
 * Generate a plan for a single already-rewritten query.
 * This is a thin wrapper around planner() and takes the same parameters.
 */
PlannedStmt *
pg_plan_query(Query *querytree, int cursorOptions, ParamListInfo boundParams)
/* call the optimizer */
    plan = planner(querytree, cursorOptions, boundParams);

 \src\backend\optimizer\plan\Planner.c

/*****************************************************************************
 *
 *       Query optimizer entry point
 *
 * To support loadable plugins that monitor or modify planner behavior,
 * we provide a hook variable that lets a plugin get control before and
 * after the standard planning process.  The plugin would normally call
 * standard_planner().
 *
 * Note to plugin authors: standard_planner() scribbles on its Query input,
 * so you'd better copy that data structure if you want to plan more than once.
 *
 *****************************************************************************/
PlannedStmt *
planner(Query *parse, int cursorOptions, ParamListInfo boundParams)

CN 节点调用 pgxc_planner(parse, cursorOptions, boundParams);

DN节点调用standard_planner(parse, cursorOptions, boundParams);

\src\backend\optimizer\plan\Planner.c

#ifdef PGXC
        /*
         * A Coordinator receiving a query from another Coordinator
         * is not allowed to go into PGXC planner.
         */
        if (IS_PGXC_LOCAL_COORDINATOR)
            result = pgxc_planner(parse, cursorOptions, boundParams);
        else
#endif
            result = standard_planner(parse, cursorOptions, boundParams);

 CN 节点调用 pgxc_planner(parse, cursorOptions, boundParams);

\src\backend\optimizer\plan\Planner.c

/*
 * Build up a QueryPlan to execute on.
 *
 * This functions tries to find out whether
 * 1. The statement can be shipped to the Datanode and Coordinator is needed
 *    only as a proxy - in which case, it creates a single node plan.
 * 2. The statement can be evaluated on the Coordinator completely - thus no
 *    query shipping is involved and standard_planner() is invoked to plan the
 *    statement
 * 3. The statement needs Coordinator as well as Datanode for evaluation -
 *    again we use standard_planner() to plan the statement.
 *
 * The plan generated in either of the above cases is returned.
 */
PlannedStmt *
pgxc_planner(Query *query, int cursorOptions, ParamListInfo boundParams)
{
    PlannedStmt *result;

    /* see if can ship the query completely */
    result = pgxc_FQS_planner(query, cursorOptions, boundParams);
    if (result)
        return result;

    /* we need Coordinator for evaluation, invoke standard planner */
    result = standard_planner(query, cursorOptions, boundParams);
    return result;
}

 \src\backend\optimizer\plan\Planner.c

standard_planner(parse, cursorOptions, boundParams);

PlannedStmt *
standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
{// #lizard forgives
    PlannedStmt *result;
    PlannerGlobal *glob;
    double        tuple_fraction;
    PlannerInfo *root;
    RelOptInfo *final_rel;
    Path       *best_path;
    Plan       *top_plan;
    ListCell   *lp,
               *lr;

#ifdef XCP
    if (IS_PGXC_LOCAL_COORDINATOR && parse->utilityStmt &&
            IsA(parse->utilityStmt, RemoteQuery))
        return pgxc_direct_planner(parse, cursorOptions, boundParams);
#endif
    /*
     * Set up global state for this planner invocation.  This data is needed
     * across all levels of sub-Query that might exist in the given command,
     * so we keep it in a separate struct that's linked to by each per-Query
     * PlannerInfo.
     */
    glob = makeNode(PlannerGlobal);
   ...
#ifdef __TBASE__
    groupOids = NULL;
	min_workers_of_hashjon_gather = PG_INT32_MAX;
#endif
   ...
 /* Determine what fraction of the plan is likely to be scanned */
    if (cursorOptions & CURSOR_OPT_FAST_PLAN)
...
 /* primary planning entry point (may recurse for subqueries) */
    root = subquery_planner(glob, parse, NULL,
                            false, tuple_fraction);

    /* Select best Path and turn it into a Plan */
    final_rel = fetch_upper_rel(root, UPPERREL_FINAL, NULL);
    best_path = get_cheapest_fractional_path(final_rel, tuple_fraction);

    if (!root->distribution)
        root->distribution = best_path->distribution;

#ifdef __TBASE__
    if (root->distribution && !parse->hasUnshippableTriggers)
    {
        remote_subplan_depth++;
    }
#endif
    top_plan = create_plan(root, best_path);
#ifdef XCP
#ifdef __TBASE__
    if (root->distribution && !parse->hasUnshippableTriggers)
#else
    if (root->distribution)
#endif
    {
        /*
         * FIXME, this keeps adding RemoteSubplan at a top of queries that
         * don't really need it (e.g above a MergeAppend with subplans pushed
         * to remote nodes). Not sure why it's happening, though ...
         */
        top_plan = (Plan *) make_remotesubplan(root, top_plan, NULL,
                                               root->distribution,
                                               root->sort_pathkeys);
        SS_remote_attach_initplans(root, top_plan);
        remote_subplan_depth--;
    }
#endif
  ...
  /*
     * If creating a plan for a scrollable cursor, make sure it can run
     * backwards on demand.  Add a Material node at the top at need.
     */
    if (cursorOptions & CURSOR_OPT_SCROLL)
    {
        if (!ExecSupportsBackwardScan(top_plan))
            top_plan = materialize_finished_plan(top_plan);
    }

    /*
     * Optionally add a Gather node for testing purposes, provided this is
     * actually a safe thing to do.
     */
    if (force_parallel_mode != FORCE_PARALLEL_OFF && top_plan->parallel_safe)
    {
        Gather       *gather = makeNode(Gather);

        gather->plan.targetlist = top_plan->targetlist;
        gather->plan.qual = NIL;
        gather->plan.lefttree = top_plan;
        gather->plan.righttree = NULL;
        gather->num_workers = 1;
        gather->single_copy = true;
        gather->invisible = (force_parallel_mode == FORCE_PARALLEL_REGRESS);

        /*
         * Ideally we'd use cost_gather here, but setting up dummy path data
         * to satisfy it doesn't seem much cleaner than knowing what it does.
         */
        gather->plan.startup_cost = top_plan->startup_cost +
            parallel_setup_cost;
        gather->plan.total_cost = top_plan->total_cost +
            parallel_setup_cost + parallel_tuple_cost * top_plan->plan_rows;
        gather->plan.plan_rows = top_plan->plan_rows;
        gather->plan.plan_width = top_plan->plan_width;
        gather->plan.parallel_aware = false;
        gather->plan.parallel_safe = false;

        /* use parallel mode for parallel plans. */
        root->glob->parallelModeNeeded = true;

        top_plan = &gather->plan;
    }
 /*
     * If any Params were generated, run through the plan tree and compute
     * each plan node's extParam/allParam sets.  Ideally we'd merge this into
     * set_plan_references' tree traversal, but for now it has to be separate
     * because we need to visit subplans before not after main plan.
     */
    if (glob->nParamExec > 0)
    {
        Assert(list_length(glob->subplans) == list_length(glob->subroots));
        forboth(lp, glob->subplans, lr, glob->subroots)
        {
            Plan       *subplan = (Plan *) lfirst(lp);
            PlannerInfo *subroot = (PlannerInfo *) lfirst(lr);

            SS_finalize_plan(subroot, subplan);
        }
        SS_finalize_plan(root, top_plan);
    }
...

 standard_planner函数调用的——subquery_planner函数
subquery_planner 
函数接受Query查询树,最后通过PlannedStmt结构体的形式返回Plan计划树。(Plan计划树被封装在PlannedStmt结构体中)subquery_planner函数负责创建计划,可以递归处理子查询。subquery_planner函数的工作分为两个部分:
1:依据消除冗余条件,减少查询层次,简化路径生成的基本思想,调用预处理函数对查询树进行处理 
2:调用inheritance_planner 或者grouping_planner进入生成计划流程,此过程不对查询树做出实质性改变
 

 \src\backend\optimizer\plan\Planner.c

/*--------------------
 * subquery_planner
 *      Invokes the planner on a subquery.  We recurse to here for each
 *      sub-SELECT found in the query tree.
 *
 * glob is the global state for the current planner run.
 * parse is the querytree produced by the parser & rewriter.
 * parent_root is the immediate parent Query's info (NULL at the top level).
 * hasRecursion is true if this is a recursive WITH query.
 * tuple_fraction is the fraction of tuples we expect will be retrieved.
 * tuple_fraction is interpreted as explained for grouping_planner, below.
 *
 * Basically, this routine does the stuff that should only be done once
 * per Query object.  It then calls grouping_planner.  At one time,
 * grouping_planner could be invoked recursively on the same Query object;
 * that's not currently true, but we keep the separation between the two
 * routines anyway, in case we need it again someday.
 *
 * subquery_planner will be called recursively to handle sub-Query nodes
 * found within the query's expressions and rangetable.
 *
 * Returns the PlannerInfo struct ("root") that contains all data generated
 * while planning the subquery.  In particular, the Path(s) attached to
 * the (UPPERREL_FINAL, NULL) upperrel represent our conclusions about the
 * cheapest way(s) to implement the query.  The top level will select the
 * best Path and pass it through createplan.c to produce a finished Plan.
 *--------------------
 */
PlannerInfo *
subquery_planner(PlannerGlobal *glob, Query *parse,
                 PlannerInfo *parent_root,
                 bool hasRecursion, double tuple_fraction)
 

 子链接和子查询的区别:子查询是一条完整的查询语句,而子链接是一条表达式,但是表达式内部也可以包含查询语句。直白点说呢就是:子查询是放在FROM子句里的而子链接则出现在WHERE子句或者HAVING子句中。
在subquery_planner函数里,调用pull_up_sublinks函数处理WHERE子句和JOIN/ON子句中的ANY和EXISTS类型的子链接。 

 subquery_planner函数调用pull_up_subqueries函数来提升子查询。当子查询仅仅是一个简单的扫描或者连接时,就会把子查询或者子查询的一部分合并到父查询中以进行优化。
1.在范围表中存在子查询。对于简单的子查询,直接调用pull_up_simple_subquery函数进行提升;而对于简单的UNION ALL子查询,调用pull_up_simple_union_all函数进行提升,其他的情况则不处理;
2.在FROM表达式中存在子查询。对于FROM列表中的每个节点都调用pull_up_subqueries递归处理;
3.连接表达式中的子查询。调用pull_up_subqueries函数递归地处理. 

/*
 * pull_up_subqueries
 *        Look for subqueries in the rangetable that can be pulled up into
 *        the parent query.  If the subquery has no special features like
 *        grouping/aggregation then we can merge it into the parent's jointree.
 *        Also, subqueries that are simple UNION ALL structures can be
 *        converted into "append relations".
 */
void
pull_up_subqueries(PlannerInfo *root)

表达式的预处理工作主要由函数preprocess_expression完成。该函数采用递归扫描的方式处理PlannerInfo结构体里面保存的目标属性、HAVING子句、OFFSET子句、LIMIT子句和连接树jointree。总体来说做了以下这些事
1.调用flatten_join_alias_vars函数,用基本关系变量取代连接别名变量;
2.调用函数eval_const_expression进行常量表达式的简化,也就是直接计算出常量表达式的值。例如:“3+1 <> 4” 这种会直接被替换成“FALSE”;
3.调用canonicalize_qual函数对表达式进行规范化,主要是将表达式转换为最佳析取范式或者合取范式
4.调用函数make_subplan将子链接转换为子计划.
 

 \src\backend\optimizer\plan\Planner.c

/*
 * preprocess_expression
 *        Do subquery_planner's preprocessing work for an expression,
 *        which can be a targetlist, a WHERE clause (including JOIN/ON
 *        conditions), a HAVING clause, or a few other things.
 */
static Node *
preprocess_expression(PlannerInfo *root, Node *expr, int kind)
{// #lizard forgives
    /*
     * Fall out quickly if expression is empty.  This occurs often enough to
     * be worth checking.  Note that null->null is the correct conversion for
     * implicit-AND result format, too.
     */
    if (expr == NULL)
        return NULL;

    /*
     * If the query has any join RTEs, replace join alias variables with
     * base-relation variables.  We must do this before sublink processing,
     * else sublinks expanded out from join aliases would not get processed.
     * We can skip it in non-lateral RTE functions, VALUES lists, and
     * TABLESAMPLE clauses, however, since they can't contain any Vars of the
     * current query level.
     */
    if (root->hasJoinRTEs &&
        !(kind == EXPRKIND_RTFUNC ||
          kind == EXPRKIND_VALUES ||
          kind == EXPRKIND_TABLESAMPLE ||
          kind == EXPRKIND_TABLEFUNC))
        expr = flatten_join_alias_vars(root, expr);

    /*
     * Simplify constant expressions.
     *
     * Note: an essential effect of this is to convert named-argument function
     * calls to positional notation and insert the current actual values of
     * any default arguments for functions.  To ensure that happens, we *must*
     * process all expressions here.  Previous PG versions sometimes skipped
     * const-simplification if it didn't seem worth the trouble, but we can't
     * do that anymore.
     *
     * Note: this also flattens nested AND and OR expressions into N-argument
     * form.  All processing of a qual expression after this point must be
     * careful to maintain AND/OR flatness --- that is, do not generate a tree
     * with AND directly under AND, nor OR directly under OR.
     */
    expr = eval_const_expressions(root, expr);

    /*
     * If it's a qual or havingQual, canonicalize it.
     */
    if (kind == EXPRKIND_QUAL)
    {
        expr = (Node *) canonicalize_qual((Expr *) expr);

#ifdef OPTIMIZER_DEBUG
        printf("After canonicalize_qual()\n");
        pprint(expr);
#endif
    }

    /* Expand SubLinks to SubPlans */
    if (root->parse->hasSubLinks)
        expr = SS_process_sublinks(root, expr, (kind == EXPRKIND_QUAL));

    /*
     * XXX do not insert anything here unless you have grokked the comments in
     * SS_replace_correlation_vars ...
     */

    /* Replace uplevel vars with Param nodes (this IS possible in VALUES) */
    if (root->query_level > 1)
        expr = SS_replace_correlation_vars(root, expr);

    /*
     * If it's a qual or havingQual, convert it to implicit-AND format. (We
     * don't want to do this before eval_const_expressions, since the latter
     * would be unable to simplify a top-level AND correctly. Also,
     * SS_process_sublinks expects explicit-AND format.)
     */
    if (kind == EXPRKIND_QUAL)
        expr = (Node *) make_ands_implicit((Expr *) expr);

    return expr;
}

/*
 * Expand SubLinks to SubPlans in the given expression.
 *
 * The isQual argument tells whether or not this expression is a WHERE/HAVING
 * qualifier expression.  If it is, any sublinks appearing at top level need
 * not distinguish FALSE from UNKNOWN return values.
 */
Node *
SS_process_sublinks(PlannerInfo *root, Node *expr, bool isQual)
{
    process_sublinks_context context;

    context.root = root;
    context.isTopQual = isQual;
    return process_sublinks_mutator(expr, &context);
}

 process_sublinks_mutator  引用了make_subplan 函数

/*
 * Convert a SubLink (as created by the parser) into a SubPlan.
 *
 * We are given the SubLink's contained query, type, ID, and testexpr.  We are
 * also told if this expression appears at top level of a WHERE/HAVING qual.
 *
 * Note: we assume that the testexpr has been AND/OR flattened (actually,
 * it's been through eval_const_expressions), but not converted to
 * implicit-AND form; and any SubLinks in it should already have been
 * converted to SubPlans.  The subquery is as yet untouched, however.
 *
 * The result is whatever we need to substitute in place of the SubLink node
 * in the executable expression.  If we're going to do the subplan as a
 * regular subplan, this will be the constructed SubPlan node.  If we're going
 * to do the subplan as an InitPlan, the SubPlan node instead goes into
 * root->init_plans, and what we return here is an expression tree
 * representing the InitPlan's result: usually just a Param node representing
 * a single scalar result, but possibly a row comparison tree containing
 * multiple Param nodes, or for a MULTIEXPR subquery a simple NULL constant
 * (since the real output Params are elsewhere in the tree, and the MULTIEXPR
 * subquery itself is in a resjunk tlist entry whose value is uninteresting).
 */
static Node *
make_subplan(PlannerInfo *root, Query *orig_subquery,
             SubLinkType subLinkType, int subLinkId,
             Node *testexpr, bool isTopQual)

函数make_subplan,  其执行步骤如下:

1)首先复制子链接SubLink中的查询树Query,如果查询树是一个EXISTS型的子计划,那么则调用simplify_EXISTS_query函数对QUery副本进行处理;
2)调用subquery_planner函数为子链接生成计划,同时设置好参数tuple_fraction来告诉底层规划器需要去多少个元组。对于EXISTS型的子查询,设置该值为1.0,取回一个元组即可;对于ALL和ANY型的子查询,从概率上说大约取到50%的元组就可以得到结果,因此设置参数值为0.5;对于其他的查询,统一设置为0;
3)调用build_subplan函数将上一步生成的计划转换为SubPlan或者InitPlan的形式,并将当前查询层次的参数列表传递给它的子计划;
4)对于生成的是SubPlan而且是一个简单的EXISTS类型的查询,调用convert_EXISTS_to_ANY函数尝试将其转换为一个ANY类型的查询并创建查询计划. 

处理HAVING子句

对于HAVING子句来说,除了进行前面所提到的预处理外,还需要处理其中的每个条件。如果HAVING子句中没有聚集函数的话,那么它完全可以退化到WHERE子句中去,否则的话他将被写到查询树的HavingQual字段里面。 

HavingQual / Qual  转换成隐式 的 and  样式。

List *
make_ands_implicit(Expr *clause)
{
    /*
     * NB: because the parser sets the qual field to NULL in a query that has
     * no WHERE clause, we must consider a NULL input clause as TRUE, even
     * though one might more reasonably think it FALSE.  Grumble. If this
     * causes trouble, consider changing the parser's behavior.
     */
    if (clause == NULL)
        return NIL;                /* NULL -> NIL list == TRUE */
    else if (and_clause((Node *) clause))
        return ((BoolExpr *) clause)->args;
    else if (IsA(clause, Const) &&
             !((Const *) clause)->constisnull &&
             DatumGetBool(((Const *) clause)->constvalue))
        return NIL;                /* constant TRUE input -> NIL list */
    else
        return list_make1(clause);
}

Tbase基础积累一 1、概述 Tbase 是在开源数据库postgresql的基础进行开发的高度兼容oracle语法的分布式数据库 具体查看:https://github.com/Tencent/TBase/wiki 2、架构图 Coordinator:协调节点(简称CN),对外提供接口,负责数据的分发和查询规划,多 个节点位置对等,每个节点都提供相同的数据库视图;在功能上CN上只存储系统的全 局元数据,并不存储实际的业务数据。 Datanode:处理存储本节点相关的元数据,每个节点还存储业务数... 阅读详情

相关推荐

TBase杂谈

TDSQL TBase杂谈

北光 651

TBase开源版V2.1.0 集群搭建部署完整版

一、公司有项目要用到TBase数据库集群,本来是我们组一个前辈搭好的,然后dn1和dn2总是没法同步,或者说是同步不完全(dn1建的表写入数据,dn2里会有不完整的表结构,但是没有其他的,后来找到原因是最大连接数的配置问题),一直找不到原因,项目经理大笔一挥,重新部署一套。然而我们组那个前辈去重保某个重要项目了,我赶鸭子上架,以前用都不会用,现在要两天内搭一套集群出来,还得带负载均衡。 其实说起来并不困难,主要是难在我经验过少,又是踩坑无数的学习过程,现在我搭的集群已经开始正常运行了,这篇文章拿来做个记录。

aidream1239的博客 4381

TBase:TBase是企业级分布式HTAP数据库。 通过单个数据库集群为用户提供高度一致的分布式数据库服务和高性能数据仓库服务,形成了一组集成的企业级解决方案

TBase数据库管理系统 TBase是基于Postgres-XL项目先前工作的高级企业级数据库管理系统。 它支持SQL标准的扩展子集,包括事务,外键,用户定义的类型和函数。 另外,它增加了并行计算,安全性,管理,审计和其他功能。 TBase具有许多类似于PostgreSQL语言接口,其中许多在这里列出: https://www.postgresql.org/download 概述 一个TBase集群由多个CoordinateNode,DataNode和GTM节点组成。 所有用户数据都驻留在DataNode中,CoordinateNode仅包含元数据,即用于全局事务管理的GTM。 CoordinateNodes和DataNodes共享相同的架构。 用户始终连接到CoordinateNodes,后者将查询分为在DataNodes中执行的片段,并收集结果。 可以从以下位置获取此软件的最新

什么是TBase?

TBase是一个提供写可靠性,多主节点数据同步的关系数据库集群平台。你可以将TBase配置一台或者多台主机上,TBase数据存储在多台物理主机上面。数据表的存储有两种方式, 分别是distributed或者replicated ,当向TBase发送查询 SQL时,TBase会自动向数据节点发出查询语句并获取最终结果。

荷塘月色 811

TBase 集群安装记录

国产数据库 Tbase 集群部署

tbase单机版安装

tbase是基于pg的分布式数据库,单机版安装介质,用于单机部署。

TBase环境部署过程及使用一

TBase简介 Tbase是腾讯开源的一个提供写可靠性,多主节点数据同步的关系数据库集群平台.你可以将Tbase配置一台或者多台主机上,Tbase数据存储在多台物理主机上面.数据表的存储有两种方式,分别是分布式或者复制,当向TBase发送查询SQL时,TBase会自动向数据节点发出查询语句并获取最终结果。 TBase采用分布式集群架构(如下图),该架构分布式为无共享(无共享)模式,节点之间相应独立,各自处理自己的数据,处理后的结果可能向上层汇总或在节点间流转,各处理单元之间通过网络协议进行通信,并行处理

Leroy的博客 4624

TBase数据库教程

简单易用 开箱即用的用户体验,清晰合理的分布式架构方案,便捷的现有业务迁移接入。 安全可靠 支持金融级别的两地三中心容灾方案,特有的数据行级非对称加密特性,完善的数据访问安全管理和审计功能。 按需扩展,高效灵活 支撑海量数据的高并发在线交易型业务,提供灵活、完善的数据治理功能,助力解决各种数据治理难题。 简化运维 沉淀了丰富的运维经验,积累了大量数据库运维工具,降低分布式系统的运维门槛。

TBase源码编译安装

TBase源码编译安装

荷塘月色 296

Windows下通过Ollama安装使用DeepSeek本地大模型

本地安装运行Deepseek大模型

canbaojun的博客 1294

概率论基础-严士健 第二版 习题与补充1.6答案

概率论基础-严士健 第二版 习题与补充1.6答案 1.不独立。 设有一均匀正八面体,其第1,2,3,4面染红色,第1,2,3,5面染白色,第1,6,7,8面染黑色,现在以A,B,C分别表示投一次正八面体出现红、白、黑的事件,则 P(A)=P(B)=P(C)=12.P(A) = P(B) = P(C) = \frac{1}{2}.P(A)=P(B)=P(C)=21​. P(ABC)=18=P(A)P...

weixin_42341993的博客 2523

TBase集群安装配置

1.较准机器的时间 停止chronyd服务 :systemctl stop chronyd 设置chronyd服务开机不自启: systemctl disable chronyd 2.防火墙与selinux配置 关闭seLinux:setenforce 0 设置selinu开机不启动: vi /etc/sysconfig/selinux 将其中的SELINUX= XXXXXX修改为SELINUX...

Silence Ray的博客 1717

Excel基金净值自动更新:手把手教你用Power Query抓取天天基金网数据(含常见错误修复)

本文详细介绍了如何利用Excel内置的Power Query工具,从天天基金网自动抓取基金净值数据,实现表格数据的自动刷新。通过手把手教程,您将学会构建参数化查询、整合多基金数据、计算持仓盈亏,并解决网页结构变动等常见错误,最终打造一个专属的、可自动更新的基金监控仪表盘,彻底告别手动更新。

xx56789的博客 747

如何快速部署TBase集群?从安装到启动的完整教程

TBase是一款企业级分布式HTAP数据库,通过单一数据库集群为用户提供高一致性的分布式数据库服务和高性能的数据仓库服务,形成一套完整的企业级解决方案。本文将详细介绍从环境准备到集群启动的全流程,帮助新手用户快速部署TBase集群。 ## 📋 准备工作:环境与依赖检查 在开始部署前,请确保服务器满足以下条件: - 操作系统:Linux(推荐CentOS 7+或Ubuntu 18.04+) -

gitblog_00579的博客 1120

实用电路精讲系列---双级运放放大电路(差分放大+跟随缓冲)

本文分析了双极运放放大电路的工作原理及其典型应用。该电路结合差分放大器和跟随缓冲器,实现高精度信号放大与阻抗匹配。差分放大器通过放大差模信号并抑制共模噪声提升信噪比;跟随缓冲器则提供阻抗变换,确保信号稳定传输。两者协同工作可优化输入阻抗、增强噪声抑制并提高设计灵活性。文章还列举了10个典型应用案例,包括医疗设备、工业传感器和新能源系统等,展示了该电路在精密电子系统中的关键作用。最后通过实用电路分析,详细说明了各模块功能及设计注意事项。

weixin_40590799的博客 2976

循环神经网络(RNN)

在之前学习了全连接神经网络(DNN)模型,网络结构都是从输入层到隐含层再到输出层,层与层之间是全连接或部分连接的,但每层之间的节点是无连接的。 一、神经网络基础 神经网络可以当做是能够拟合任意函数的黑盒子,只要训练数据足够,给定特定的x,就能得到希望的y,结构图如下: 将神经网络模型训练好之后,在输入层给定一个x,通过网络之后就能够在输出层得到特定的y,那么既然有了这么强大的模型,为什么还需要RNN(循环神经网络)呢? 二、为什么需要RNN(循环神经网络) 考虑这样一个问题,如果要预测句子的下一个单词是什么

小朱小朱绝不认输的博客 2万+

TBase安装

TBase 安装

荷塘月色 372

Llama模型结构拆解:为什么MLP模块要这样设计?从参数配置到计算流程全解析

本文深入解析了Llama模型MLP模块的设计精髓。通过拆解其三线性层结构、门控机制与SwiGLU激活函数,揭示了并行计算如何提升效率,并详细阐述了intermediate_size参数配置背后的经验权衡与计算考量,帮助读者透彻理解这一核心组件的设计逻辑与工程实现。

mac99的博客 532

TBase 开源项目教程

TBase 是一个企业级的分布式 HTAP 数据库,通过单一数据库集群为用户提供高度一致的分布式数据库服务和高性能的数据仓库服务,形成了一套集成化的企业级解决方案。TBase 基于 Postgres-XL 项目,支持扩展的 SQL 标准子集,包括事务、外键、用户定义类型和函数等。此外,TBase 还增加了并行计算、安全、管理、审计等功能。 ## 2. 项目快速启动 ### 2.1 环境准备

gitblog_00422的博客 900

蓝桥杯STM32 G431 hal库开发速成——GPIO输入——按键长短按,按键单双击

将TIM与GPIO输入(按键)结合起来使用,很好的练习项目。按键长短按,按键单双击。STM32定时器常见问题

weixin_44860466的博客 2621

【图像超分】论文复现:经典超分 | SAN的Pytorch源码复现,跑通源码,适配高版本的python/pytorch/cuda,使用EDSR-PyTorch进行训练和测试

本文介绍了单幅图像超分辨率重建方法SAN(二阶注意网络)的代码实现。文章详细说明了在高版本Python/Pytorch环境下适配SAN源码的方法,并提供了修改后的完整代码和预训练模型下载链接。 主要亮点包括: 将SAN模型实现整合到EDSR-Pytorch框架中,解决了高版本环境下的兼容性问题 提供了完整的数据集准备指南(DIV2K训练集和5个测试集) 给出了详细的测试命令,涵盖x2、x3、x4不同放大倍率 公开了预训练模型和可视化结果的下载资源 提供了修改后的适配高版本环境的代码。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 1421

TBase数据库项目常见问题解决方案

TBase 是腾讯开源的一个企业级分布式 HTAP(Hybrid Transactional/Analytical Processing)数据库。它基于 PostgreSQL 的分支 Postgres-XL 项目进行开发,支持扩展的 SQL 标准功能,包括事务、外键、用户定义类型和函数等。此外,TBase 还添加了并行计算、安全、管理、审计等功能。项目主要使用 C 语言进行开发,同时提供了多种编程

gitblog_00229的博客 896

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

TBase开源版V2.1.0集群搭建部署完整版

TBase开源版V2.1.0集群搭建部署完整版

荷塘月色 796

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Tbase 源码 (三)

Tbase 源码 (三) 查询优化——生成路径

driftingman的专栏 1796

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

TBase数据库完全指南:企业级分布式HTAP解决方案核心特性解析

TBase是一款企业级分布式HTAP数据库,通过单一数据库集群为用户提供高度一致的分布式数据库服务和高性能数据仓库服务,形成一套完整的企业级解决方案。作为融合事务处理与分析能力的创新型数据库,TBase正在成为企业数字化转型的关键基础设施。 ## 什么是HTAP?一站式数据处理新范式 🚀 HTAP(Hybrid Transactional/Analytical Processing)即混合事

gitblog_00416的博客 1184

Tbase 源码 (二)

Tbase 源码 (二) 查询优化——生成路径

driftingman的专栏 595
上一篇: Postgres-XL 10 使用介绍(三)
下一篇: Tbase 源码 (二)
driftingman
博客等级 码龄20年 81粉丝 46原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值