如何创建DB2多实例?

如何创建DB2多实例?,db2,chef-infra,Db2,Chef Infra,我有一个响应文件,它创建了一个DB2实例 如何使用响应文件创建多个Db2实例以进行Db2的静默安装?最好的猜测是创建一个模板 然后在配方中,使用不同的参数从模板创建文件,并通知资源的执行情况 类似这样的内容(未经测试的代码,仅用于说明): Attribute.rb default['db2']['instances']['A']['port'] = 1234 default['db2']['instances']['A']['bind_adress'] = "*" default['db2'][

我有一个响应文件,它创建了一个DB2实例


如何使用响应文件创建多个Db2实例以进行Db2的静默安装?

最好的猜测是创建一个模板

然后在配方中,使用不同的参数从模板创建文件,并通知资源的执行情况

类似这样的内容(未经测试的代码,仅用于说明):

Attribute.rb

default['db2']['instances']['A']['port'] = 1234
default['db2']['instances']['A']['bind_adress'] = "*"
default['db2']['instances']['A']['password'] = "whatever"

default['db2']['instances']['B']['port'] = 1235
default['db2']['instances']['B']['bind_adress'] = "*"
default['db2']['instances']['B']['password'] = "whatever"
default.rb(配方)


在响应文件中,可以定义多个实例。你必须把它们定义为

INSTANCE                  = DB2_INS2        ** char(8)  no spaces
然后,为这个实例定义每个元素

DB2_INS2.NAME             = db2inst1        ** char(8)  no spaces, no upper case letters
DB2_INS2.GROUP_NAME       = db2iadm1        ** char(30) no spaces
work
DB2_INS2
只是响应文件中的一个名称,而不是实例的名称

你可以说出任何名字。另一方面,它可能是

INSTANCE                  = PROD        ** char(8)  no spaces
PROD.NAME             = db2inst1        ** char(8)  no spaces, no upper case letters
PROD.GROUP_NAME       = db2iadm1        ** char(30) no spaces
响应文件有一个部分解释如何定义多个实例:

** 2nd (non-pureScale) Instance Creation Settings
** ----------------------------------------------
** Multiple (non-pureScale) DB2 instances can be created in the same
** installation. This section shows how to specify the 2nd instance in the rsp
** file. Note: Only a subset of the instance keywords are listed below. You can
** specify other instance related keywords similar as the 1st instance. All
** keywords in this section are commented out. By default, only one instance
** will be created during the install.

这不是DB2响应文件。这并不能回答所问的问题。@AngocA Op的问题是如何处理chef,不知道我为chef部分回答的文件的格式。如果不需要厨师,则会有一个坏标签,在删除答案之前等待Op评论。实例=#{node['xxxx']}#{node['xxxx']}。名称=#{node['xxxx']}#{node['xxxx']}。组名=#{node['xxxx']}#{node['xxxx']}。端口号=50000#{node['xxxx']}.FCM_PORT_NUMBER=60000这里我想为实例的每个值增加FCM编号和端口编号增量。请帮我解决一下,您对上述疑问有何想法(在上面的评论中提到)我知道您使用的语法。为什么可以将文件动态创建为响应文件?为什么不直接创建实例,这会使过程更加复杂?如果用户想要创建10个带有响应文件的DB2实例,那么再次手动编写相同的代码是不好的,相反,他最好为每个循环运行,在循环中传递所有实例名称,并使用codeknife引导程序-x”“-P”“-j{“instance”:“inst1 inst2 inst3 inst4 inst5”}为所有循环创建实例属性,就像这样当用户运行上述命令时,然后在resposne文件中使用for each循环就好了。
** 2nd (non-pureScale) Instance Creation Settings
** ----------------------------------------------
** Multiple (non-pureScale) DB2 instances can be created in the same
** installation. This section shows how to specify the 2nd instance in the rsp
** file. Note: Only a subset of the instance keywords are listed below. You can
** specify other instance related keywords similar as the 1st instance. All
** keywords in this section are commented out. By default, only one instance
** will be created during the install.