- Oracle SOA Suite on Kubernetes
- 管理ガイド
- T3/T3Sプロトコルの公開
- 管理対象サーバーのT3/T3Sの公開
管理対象サーバーのT3/T3Sの公開
リスニング・ポートlisten_portおよびペア・パブリック・ポートpublic_portを使用して、すべての管理対象サーバー用のカスタムT3/T3Sチャネルを作成するには:
- 次の内容で
t3_ms_config.py
を作成します:admin_pod_name = sys.argv[1] admin_port = sys.argv[2] user_name = sys.argv[3] password = sys.argv[4] listen_port = sys.argv[5] public_port = sys.argv[6] public_address = sys.argv[7] managedNameBase = sys.argv[8] ms_count = sys.argv[9] channelType = sys.argv[10] print('custom host : [%s]' % admin_pod_name); print('custom port : [%s]' % admin_port); print('custom user_name : [%s]' % user_name); print('custom password : ********'); print('public address : [%s]' % public_address); print('channel listen port : [%s]' % listen_port); print('channel public listen port : [%s]' % public_port); connect(user_name, password, 't3://' + admin_pod_name + ':' + admin_port) edit() startEdit() for index in range(0, int(ms_count)): cd('/') msIndex = index+1 cd('/') name = '%s%s' % (managedNameBase, msIndex) cd('Servers/%s/' % name ) if channelType == 't3': create('T3Channel_MS','NetworkAccessPoint') cd('NetworkAccessPoints/T3Channel_MS') set('Protocol','t3') set('ListenPort',int(listen_port)) set('PublicPort',int(public_port)) set('PublicAddress', public_address) print('Channel T3Channel_MS added ...for ' + name) elif channelType == 't3s': create('T3SChannel_MS','NetworkAccessPoint') cd('NetworkAccessPoints/T3SChannel_MS') set('Protocol','t3s') set('ListenPort',int(listen_port)) set('PublicPort',int(public_port)) set('PublicAddress', public_address) set('HttpEnabledForThisProtocol', true) set('OutboundEnabled', false) set('Enabled', true) set('TwoWaySSLEnabled', true) set('ClientCertificateEnforced', false) print('Channel T3SChannel_MS added ...for ' + name) else: print('Protocol [%s] not supported' % channelType) activate() disconnect()
t3_ms_config.py
を管理サーバー・ポッド(たとえば、soans
ネームスペースのsoainfra-adminserver
)のドメイン・ホーム(たとえば、/u01/oracle/user_projects/domains/soainfra
)にコピーします。kubectl cp t3_ms_config.py soans/soainfra-adminserver:/u01/oracle/user_projects/domains/soainfra
- 次のパラメータを使用し、管理サーバー・ポッドに対するexecで
wlst.sh t3_ms_config.p
yを実行します:- admin_pod_name: soainfra-adminserver # 管理サーバー・ポッド
- admin_port: 7001
- user_name: weblogic
- password: Welcome1 # weblogicパスワード
- listen_port: 30016 # T3管理対象サーバーの新規ポート
- public_port: 30016 # 外部でT3ポートを公開するために使用されるKubernetes NodePort
- public_address:
- managedNameBase: soa_server # 管理対象サーバーのベース名の指定。osb_clusterの場合、これはosb_serverになります
- ms_count: 5 # 構成済管理対象サーバー数
- channelType: t3 # channelTypeはt3またはt3sです
admin_pod_name: soainfra-adminserver # Administration Server pod admin_port: 7001 user_name: weblogic password: Welcome1 # weblogic password listen_port: 30016 # New port for T3 Managed Serverspublic_port: 30016 # Kubernetes NodePort which will be used to expose T3 port externallypublic_address: managedNameBase: soa_server # Give Managed Server base name. For osb_cluster this will be osb_serverms_count: 5 # Number of configured Managed ServerschannelType: t3 # channelType is t3 or t3s
例:
kubectl exec -it soainfra-adminserver -n soans -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/user_projects/domains/soainfra/t3_ms_config.py soainfra-adminserver 7001 weblogic Welcome1 30016 30016 xxx.xxx.xxx.xxx soa_server 5 t3
- 次の内容で
t3_ms_svc.yaml
を作成し、domainNameおよびdomainUIDをsoainfra、SOAクラスタのclusterNameをsoa_clusterとして管理対象サーバー・ポート30016
でT3を公開します。同様に、Oracle Service BusクラスタのclusterNameにosb_clusterを使用して、Kubernetesサービスを作成できます:ノート:
T3Sの場合は、前のステップでwlst.sh
を使用してT3Sチャネルを作成する際にpublic_portで使用した適切な値でNodePort 30016を置き換えます。apiVersion: v1 kind: Service metadata: name: soainfra-soa-cluster-t3-external namespace: soans labels: weblogic.clusterName: soa_cluster weblogic.domainName: soainfra weblogic.domainUID: soainfra spec: type: NodePort selector: weblogic.domainName: soainfra weblogic.domainUID: soainfra weblogic.clusterName: soa_cluster ports: - name: t3soaport protocol: TCP port: 30016 targetPort: 30016 nodePort: 30016
- ポート30016のNodePortサービスを作成します:
kubectl create -f t3_ms_svc.yaml
- 次のURLを使用して、管理対象サーバーのT3にアクセスできることを確認します:
t3://<master_ip>:30016
- 同様に、次のようにT3Sにアクセスできます:
- まず、クライアントから保護された(t3s)接続に使用する証明書を管理サーバーから取得します。wlstコマンドを使用して、管理サーバーから証明書をエクスポートできます。デフォルトのdemoidentityをエクスポートするコマンドの例:
ノート:
カスタムSSL証明書を使用している場合は、それに応じてステップを置き換えますkubectl exec -it soainfra-adminserver -n soans -- bash /u01/oracle/oracle_common/common/bin/wlst.sh connect('weblogic','Welcome1','t3://soainfra-adminserver:7001') svc = getOpssService(name='KeyStoreService') svc.exportKeyStoreCertificate(appStripe='system', name='demoidentity', password='DemoIdentityKeyStorePassPhrase', alias='DemoIdentity', type='Certificate', filepath='/tmp/cert.txt/')
前述のステップでは、
/tmp/cert.txt
で証明書をダウンロードします。 - クライアント側から同じ証明書を使用し、t3sを使用して接続します。例:
export JAVA_HOME=/u01/jdk keytool -import -v -trustcacerts -alias soadomain -file cert.txt -keystore $JAVA_HOME/lib/security/cacerts -keypass changeit -storepass changeit export WLST_PROPERTIES="-Dweblogic.security.SSL.ignoreHostnameVerification=true" cd $ORACLE_HOME/oracle_common/common/bin ./wlst.sh Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands wls:/offline> connect('weblogic','Welcome1','t3s://<Master IP address>:30016')
- まず、クライアントから保護された(t3s)接続に使用する証明書を管理サーバーから取得します。wlstコマンドを使用して、管理サーバーから証明書をエクスポートできます。デフォルトのdemoidentityをエクスポートするコマンドの例: