BaaS 配置文件参考文档

Edge for Private Cloud v. 4.17.05

下面是 10 节点 API BaaS 安装的静默配置文件示例。根据您的配置需要修改此文件。使用 -f 选项 setup.sh 添加此文件。

# Specify IP address or DNS name of node.
IP1=192.168.1.1   # ElasticSearch
IP2=192.168.1.2   # ElasticSearch
IP3=192.168.1.3   # ElasticSearch
IP4=192.168.1.4   # API BaaS Stack
IP5=192.168.1.5   # API BaaS Stack
IP6=192.168.1.6   # API BaaS Stack
IP7=192.168.1.7   # API BaaS Portal
IP8=192.168.1.8   # Cassandra (shared with Edge or standalone)
IP9=192.168.1.9   # Cassandra (shared with Edge or standalone)
IP10=192.168.1.10  # Cassandra (shared with Edge or standalone)

# Must resolve to IP address or DNS name of host - not to 127.0.0.1 or localhost.
HOSTIP=$(hostname -i)

# Define the API BaaS administrator account.  
AS_ADMIN="superuser"    # User name - default is "superuser".
AS_ADMIN_EMAIL=stackAdmin@email.com
AS_PASSWD=stackAdminPWrod

# Only if you are installing Cassandra.
# Specify Cassandra data center and rack suffix.
# Must use IP addresses for CASS_HOSTS, not DNS names.
# CASS_HOSTS="$IP8:1,1 $IP9:1,1 $IP10:1,1"

# If connecting to existing Cassandra nodes, 
# specify Cassandra IPs.
# Must use IP addresses for CASS_HOSTS, not DNS names.
CASS_HOSTS="$IP8 $IP9 $IP10"

# Cassandra uname/pword.
# Even if Cassandra authentication is disabled,
# you must still pass values for these properties.
CASS_USERNAME=cassandra    # Default value
CASS_PASSWORD=cassandra    # Default value

# Specify BaaS Cassandra connection information.
# Specify the data center name.
BAAS_CASS_LOCALDC=dc-1    # Default is dc-1.

# For a single data center, specify the same value as BAAS_CASS_LOCALDC.
BAAS_CASS_DC_LIST="dc-1"

# Replication is in the form "dataCenterName:#CassandraNodes". 
# For example, for dc-1 with three Cassandra nodes, it is dc-1:3.
BAAS_CASS_REPLICATION=dc-1:3

# Defines the initial contact points for members of the BaaS cluster. 
# For a single node install, specify the IP address of the node. 
BAAS_CLUSTER_SEEDS="dc-1:$IP1"

# ElasticSearch IPs or DNS names, separated by spaces.
ES_HOSTS="$IP1 $IP2 $IP3"

# API BaaS Stack information.
# Default cluster name is "apigee_baas"
BAAS_USERGRID_CLUSTERNAME="apigee_baas" 

# URL and port of the load balancer for the API BaaS Stack nodes, 
# or IP/DNS and port 8080 of a single Stack node with no load balancer.
BAAS_USERGRID_URL=http://myloadbalancer:8443

# API BaaS Portal information.
# URL and port number of load balancer, if there is one in front of the Portal,
# or the URL and port of the Portal node.  
BAAS_PORTAL_URL="http://$IP7:9000"

# Portal port. Default value is 9000.
BAAS_PORTAL_LISTEN_PORT=9000 

# SMTP information. BaaS requires an SMTP server.
SMTPHOST=smtp.gmail.com
SMTPPORT=465
SMTPUSER=your@email.com
SMTPPASSWORD=yourEmailPassword
SMTPSSL=y

下表列出了有关这些属性的更多信息:

属性

备注

CASS_HOSTS

如果您要安装 Cassandra,请指定 Cassandra 节点 IP(而非 DNS 名称),并在其中添加用于指定 Cassandra 节点的数据中心和机架的“:dc,ra”修饰符。

例如,“192.168.124.201:1,1 = 数据中心 1 和机架/可用性地区 1”,而“192.168.124.204:2,1 = 数据中心 2 和机架/可用性地区 1”。

CASS_USERNAME
CASS_PASSWORD

Cassandra 用户名和密码。

如果停用 Cassandra 身份验证,您仍需要传递这些值。不过,系统会忽略这些值。

BAAS_CASS_LOCALDC

区域名称必须采用 dc-# 格式,其中 # 对应于整数值。

例如,dc-1、dc-2 等。如果您要连接到安装了 Edge 的 Cassandra 集群,您可以向 Edge 系统管理员索取此值。在 Edge 单个数据中心安装中,默认值为 dc-1。

如果您在安装 API BaaS 时安装了 Cassandra,那么在 Cassandra 安装期间,您可以向 Cassandra IP 地址添加“:dc,ra”修饰符。第一个值“dc”是数据中心编号。数据中心名称是字符串“dc-”,以数据中心编号为后缀。

BAAS_CASS_DC_LIST

指定与 BAAS_CASS_LOCALDC 相同的值。

BAAS_CASS_REPLICATION

格式为 dataCenterName:#CassandraNodes,不带引号。例如,对于具有三个 Cassandra 节点的 dc-1,它是 dc-1:3。

如需安装第二个数据中心,请指定两个数据中心的信息:

BAAS_CASS_REPLICATION=dc-1:3,dc-2:3

BAAS_CLUSTER_SEEDS

定义 BaaS 集群成员的初始联系人。指定数据中心内的 BaaS 栈种子节点列表(用英文双引号括起来),格式为“dc-#:nodeIP”,其中 dc-# 是数据中心的名称,如 BAAS_CASS_LOCALDC 所定义。

对于单个节点安装,请指定节点的 IP 地址。

在数据中心内有至少三个 BaaS 堆栈节点的生产环境中,将两个堆栈节点指定为种子。即使您有三个或更多堆栈节点,也不要指定两个以上的节点。

对于多个数据中心,请仅指定该数据中心内的种子节点。

BAAS_USERGRID_网址

在生产环境中,这是位于 API BaaS 堆栈节点前面的负载平衡器的网址和端口,格式为:

http://myStackLoadBalancer:8443

在测试或开发环境中,您只有一个 API BaaS 堆栈节点,可以是 API BaaS 堆栈节点的网址和端口号,格式为:

http://stackIPorDNS:8080

API BaaS 堆栈服务器的端口号为 8080。

BAAS_PORTAL_网址

负载平衡器的网址和端口号(如果门户前面有网址),形式为:

http://myPortalLoadBalancer:8443

如果没有负载平衡器,则门户节点的网址和端口号采用以下格式:

http://portalIPorDNS:9000

默认 0 为端口号 0。

BAAS_PORTAL_LISTEN_PORT

API BaaS 门户服务器的端口号为 9000。如果此端口不可用,请指定其他端口。

如果您将 BAAS_PORTAL_网址 设置为门户节点的网址,则这两个资源的端口号必须相同。