BaaS 設定檔參考資料

Edge for Private Cloud 4.18.01 版

以下是 10 節點 API BaaS 安裝作業的自動設定檔範例。請視設定需要編輯這個檔案。使用 setup.sh 的 -f 選項加入這個檔案。

# 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 datacenter_name:number_of_cassandra_nodes
# 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
SMTPMAILFROM="My Company <myco@company.com>"

下表提供這些屬性的其他資訊:

屬性 注意事項
CASS_HOSTS

如果您要安裝 Cassandra,請指定 Cassandra 節點 IP (而非 DNS 名稱),並加入「:dc,ra」修飾符,指定 Cassandra 節點的資料中心和機架。

例如「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 時,您已將「:dc,ra」修飾符新增至 Cassandra IP 位址。第一個值「dc」是資料中心編號。資料中心名稱為字串「dc-」,後置字串為資料中心編號。

BAAS_CASS_DC_LIST 指定與 BAAS_CASS_LOCALDC 相同的值。
BAAS_CASS_REPLICATION

格式為 datacenter_name:number_of_cassandra_nodes。例如,對於具有三個 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 Stack 節點,請指定兩個 Stack 節點做為種子。即使有三個以上的 Stack 節點,也請勿指定超過兩個節點。

如有多個資料中心,請僅指定該資料中心的種子節點。

BAAS_USERGRID_URL

在正式環境中,這是 API BaaS 堆疊節點前端的負載平衡器網址和通訊埠,格式如下:

http://stack_load_balancer:port

例如:

http://mystackloadbalancer:8443

在測試或開發環境中,如果只有一個 API BaaS Stack 節點,則可以是 API BaaS Stack 節點的網址和通訊埠編號,格式如下:

http://stack_IP_or_DNS:port

例如:

http://mystackip:8080

API BaaS Stack 伺服器的通訊埠號碼為 8080。

BAAS_PORTAL_URL

負載平衡器的網址和通訊埠號碼 (如果入口網站前方有負載平衡器),格式如下:

http://portal_load_balancer:port

例如:

http://myportalloadbalancer:8443

如果沒有負載平衡器,請以下列格式指定入口網站節點的網址和通訊埠編號:

http://portal_IP_or_DNS:port

例如:

http://myportal:9000

API BaaS 入口網站的通訊埠編號預設為 9000。

BAAS_PORTAL_LISTEN_PORT

API BaaS 入口網站伺服器的通訊埠號碼為 9000。如果這個通訊埠無法使用,請指定其他通訊埠。

如果您將 BAAS_PORTAL_URL 設為入口網站節點的網址,則這兩個屬性的通訊埠編號必須相同。

SMTPHOST
SMTPUSER
SMTPPASSWORD
SMTPSSL
SMTPPORT
SMTPMAILFROM

設定 SMTP,讓 API BaaS 傳送遺失密碼和其他通知的電子郵件。

如果不需要 SMTP 使用者憑證,請省略 SMTPUSER 和 SMTPPASSWORD。