AWSにkubernetesクラスタセットアップがあります。 EC2コンテナレジストリを使用して、ドッキング画像を保存しています。 マスタ/ミニオンがすべてセットアップされており、すべてがクラスタで動作しているようです。以下のようにkubernetesとそれを一般的にデバッグする
マイspecファイルには、次のとおりです。
apiVersion: v1
kind: Service
metadata:
name: apim-mysql
labels:
app: apim
spec:
ports:
# the port that this service should serve on
- port: 3306
selector:
app: apim
tier: mysql
clusterIP: None
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: apim-mysql
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: apim
tier: mysql
spec:
imagePullSecrets:
- name: myregistrykey
containers:
- name: mysql
image: <This points to our EC2 Container Registry and retreives the image>
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: WSO2_ZIP_FILE
value: wso2am-1.10.1-SNAPSHOT.zip
- name: WSO2_VERSION
value: 1.10.1
- name: MYSQL_RANDOM_ROOT_PASSWORD
value: 'yes'
- name: MYSQL_USER
value: username
- name: MYSQL_USER_PASSWD
value: password
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access environment variables to find service host
# info, comment out the 'value: dns' line above, and uncomment the
# line below.
#value: env
ports:
- containerPort: 3306
name: mysql
は何このコンテナがすることだけでMySQLを設定しています。 このノードに接続するには、クラスタ内に他のノードが必要です。 mysql DBを使用する必要があるためです。
私の最初の質問は、この仕様ファイルですべてが大丈夫だと思いますか? 誰かが何か間違っていると思われますか?
私はkubectl createコマンドを実行すると、それが正常に実行されます:
kubectl create -f mysql.yaml
service "apim-mysql" created
deployment "apim-mysql" created
ポッドを取得kubectlはポッド実行を示しています
apim-mysql-545962574-w2qz1 1/1 Running 1 8m
私は時々kubectlログをやったときに、これを示すエラーが表示されます。
kubectl logs apim-mysql-545962574-w2qz1
Error from server: dial unix /var/run/docker.sock: no such file or directory
最終的には十分にリトライします。誰かがそれがなぜ起こるのかについてのフォーメーションは素晴らしいでしょう。
kubectl logs apim-mysql-545962574-w2qz1
Initializing database
2016-07-13T15:51:47.375052Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-07-13T15:51:52.029915Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-07-13T15:51:53.531183Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: b837bd45-4911-11e6-99ba-02420af40208.
2016-07-13T15:51:53.746173Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-07-13T15:51:53.746621Z 1 [Warning] [email protected] is created with an empty password ! Please consider switching off the --initialize-insecure option.
2016-07-13T15:52:19.891437Z 1 [Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
2016-07-13T15:52:19.891705Z 1 [Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
2016-07-13T15:52:19.891733Z 1 [Warning] 'db' entry 'sys [email protected]' ignored in --skip-name-resolve mode.
2016-07-13T15:52:19.891778Z 1 [Warning] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.
2016-07-13T15:52:19.891831Z 1 [Warning] 'tables_priv' entry 'sys_config [email protected]' ignored in --skip-name-resolve mode.
Database initialized
MySQL init process in progress...
2016-07-13T15:52:34.632188Z 0 [Note] mysqld (mysqld 5.7.13) starting as process 49 ...
2016-07-13T15:52:49.814764Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-07-13T15:52:49.814846Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-13T15:52:49.814859Z 0 [Note] InnoDB: Uses event mutexes
2016-07-13T15:52:49.814870Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-07-13T15:52:49.814928Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-07-13T15:52:49.814932Z 0 [Note] InnoDB: Using Linux native AIO
2016-07-13T15:52:50.243657Z 0 [Note] InnoDB: Number of pools: 1
2016-07-13T15:52:52.175079Z 0 [Note] InnoDB: Using CPU crc32 instructions
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
少し後に、それはポッドを再起動するようだと、それは私が実行したときに数日前に...もう一度
をデータベースの初期化と言うだろう:仕事がこのような何かを得るん
kubectlはすぐに全てを返し、非常に速くなります。とても遅く、実際に何も表示しません。私の仕様ファイルを全く変更していないので、何が起こっているのか分かりません。私には、実際にいくつかのログを表示しても、コンテナが正しく実行されていないようですが、私は確信しています。
誰かが私はそれを実行することができますいくつかのコマンドでさらにこれをデバッグする方法の手掛かりがある場合は非常に感謝します。私はこの時点で非常に立ち往生しており、google'dは大いに運がありません。
ありがとうございました!
' kubectlはを記述し、 'kubectl get events'はより多くの情報を与えるかもしれません。 –
MrE