greenplum使用gpinitsystem初始化系统需要的配置文件

在greenplum中使用gpinitsystem初始化集群的时候需要指定一个配置文件,里面配置一些参数的值。在安装目录下有一个文件

/opt/greenplum1/docs/cli_help/gp_init_config_example ,里面有一些参数的解释和默认值,你可以选择基于它来创建你自己的配置文件。不过有时没必要,因为里面的内容太多了。你完全可以自己指定如下几个参数就够了。

 

ARRAY_NAME
Required. A name for the array you are configuring. You can use any name you like.
Enclose the name in quotes if the name contains spaces.

SEG_PREFIX
Required. This specifies a prefix that will be used to name the data directories on the
master and segment instances. The naming convention for data directories in a
Greenplum Database system is SEG_PREFIXnumber where number starts with 0 for
segment instances (the master is always -1). So for example, if you choose the prefix
gpseg, your master instance data directory would be named gp-1, and the segment
instances would be named gpseg0, gpseg1, gpseg2, gpseg3, and so on.

PORT_BASE
Required. This specifies the base number by which primary segment port numbers
are calculated. The first primary segment port on a host is set as PORT_BASE, and
then incremented by one for each additional primary segment on that host. Valid
values range from 1 through 65535.

DATA_DIRECTORY
Required. This specifies the data storage location(s) where the utility will create the
primary segment data directories. The utility creates a unique data directory for each
segment instance. If you want multiple segment instances per host, list a data
storage area for each primary segment you want created. The recommended number
is one primary segment per CPU. It is OK to list the same data storage area multiple
times if you want your data directories created in the same location. The number of
data directory locations specified will determine the number of primary segment
instances per host. You must make sure that the user who runs gpinitsystem (for
example, the gpadmin user) has permissions to write to these directories. You may
want to create these directories on the segment hosts before running gpinitsystem
and chown them to the appropriate user. For example:
declare -a DATA_DIRECTORY=(/data1/primary /data1/primary /data1/primary /data2/primary /data2/primary /data2/primary)

MASTER_HOSTNAME
Required. The host name of the master instance. This host name must exactly match
the configured host name of the machine (run the hostname command to determine
the correct hostname).

MASTER_DIRECTORY
Required. This specifies the location where the data directory will be created on the
master host. You must make sure that the user who runs gpinitsystem (for
example, the gpadmin user) has permissions to write to this directory. You may
want to create this directory on the master host before running gpinitsystem and
chown it to the appropriate user.

MASTER_PORT
Required. The port number for the master instance. This is the port number that
users and client connections will use when accessing the Greenplum Database
system.

TRUSTED_SHELL
Required. The shell the gpinitsystem utility uses to execute commands on remote
hosts. Allowed values are ssh. You must set up your trusted host environment
before running the gpinitsystem utility (you can use gpssh-exkeys to do this).

CHECK_POINT_SEGMENTS
Required. Maximum distance between automatic write ahead log (WAL)
checkpoints, in log file segments (each segment is normally 16 megabytes). This
will set the checkpoint_segments parameter in the postgresql.conf file for
each segment instance in the Greenplum Database system.

ENCODING
Required. The character set encoding to use. This character set must be compatible
with the --locale settings used, especially --lc-collate and --lc-ctype.
Greenplum Database supports the same character sets as PostgreSQL.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是 Greenplum 初始化数据库的详细步骤: 1. 安装 Greenplum 数据库软件:首先需要在所有节点上安装 Greenplum 数据库软件。可以从官方网站下载 Greenplum 数据库软件包,然后在每个节点上解压缩并安装软件。 2. 配置 Greenplum 数据库环境:在安装完成后,需要在所有节点上设置 Greenplum 数据库的环境变量和配置文件。可以通过编辑系统环境变量文件(如 ~/.bashrc)或者使用 Greenplum 提供的工具来设置环境变量和配置文件。 3. 配置 SSH 免密码登录:为了避免在初始化数据库过程中频繁输入服务器密码,建议在所有节点之间配置 SSH 免密码登录。可以使用 ssh-keygen 命令生成公钥和私钥,并将公钥分发到所有节点上。 4. 创建 Greenplum 数据库用户和组:为了能够运行 Greenplum 数据库,需要在所有节点上创建 Greenplum 数据库用户和组。可以使用系统自带的工具或者 Greenplum 提供的工具来创建用户和组。 5. 创建 Greenplum 数据库实例:在所有节点上创建 Greenplum 数据库实例。可以使用 Greenplum 提供的工具来创建实例,并指定每个节点的角色(如主节点、备节点、镜像节点等)。 6. 初始化数据库:在所有节点上运行 Greenplum 提供的初始化脚本来初始化数据库。在初始化过程中,需要指定数据库实例的名称和节点的角色,并选择合适的初始化选项。 7. 启动数据库:在所有节点上启动 Greenplum 数据库实例。可以使用 Greenplum 提供的工具来启动数据库,并检查数据库的运行状态。 8. 测试数据库:在数据库启动后,可以使用 psql 命令来测试数据库是否正常工作。可以连接到数据库并运行一些 SQL 命令来测试数据库的性能和功能。 总之,Greenplum 初始化数据库是一个比较复杂的过程,需要仔细阅读官方文档并按照步骤进行操作。在操作过程中,需要注意安全性和可靠性,并及时查看日志文件以解决可能出现的错误。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值