Request processing failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
Springの接続先を上のIPアドレスに置き換え
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.11.6' (61)
[ℹ] eksctl version 0.18.0
[ℹ] using region us-west-2
[✔] using existing VPC (vpc-036234633815de38e) and subnets (private:[] public:[subnet-054211583a350c088 subnet-0864ac20958b3b37c])
[!] custom VPC/subnets will be used; if resulting cluster doesn't function as expected, make sure to review the configuration of VPC/subnets
[ℹ] using EC2 key pair %!!(MISSING)q(*string=<nil>)
[ℹ] using Kubernetes version 1.15
[ℹ] creating EKS cluster "mywebsite-cluster" in "us-west-2" region with managed nodes
[ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial managed nodegroup
[ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --cluster=mywebsite-cluster'
[ℹ] CloudWatch logging will not be enabled for cluster "mywebsite-cluster" in "us-west-2"
[ℹ] you can enable it with 'eksctl utils update-cluster-logging --region=us-west-2 --cluster=mywebsite-cluster'
[ℹ] Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "mywebsite-cluster" in "us-west-2"
[ℹ] 2 sequential tasks: { create cluster control plane "mywebsite-cluster", create managed nodegroup "mywebsite-ng" }
[ℹ] building cluster stack "eksctl-mywebsite-cluster-cluster"
[ℹ] deploying stack "eksctl-mywebsite-cluster-cluster"
[ℹ] building managed nodegroup stack "eksctl-mywebsite-cluster-nodegroup-mywebsite-ng"
[ℹ] deploying stack "eksctl-mywebsite-cluster-nodegroup-mywebsite-ng"
[✔] all EKS cluster resources for "mywebsite-cluster" have been created
[✔] saved kubeconfig as "/Users/hayshogo/.kube/config"
[ℹ] nodegroup "mywebsite-ng" has 3 node(s)
[ℹ] node "ip-10-0-0-151.us-west-2.compute.internal" is ready
[ℹ] node "ip-10-0-20-235.us-west-2.compute.internal" is ready
[ℹ] node "ip-10-0-20-244.us-west-2.compute.internal" is ready
[ℹ] waiting for at least 2 node(s) to become ready in "mywebsite-ng"
[ℹ] nodegroup "mywebsite-ng" has 3 node(s)
[ℹ] node "ip-10-0-0-151.us-west-2.compute.internal" is ready
[ℹ] node "ip-10-0-20-235.us-west-2.compute.internal" is ready
[ℹ] node "ip-10-0-20-244.us-west-2.compute.internal" is ready
[ℹ] kubectl command should work with "/Users/hayshogo/.kube/config", try 'kubectl get nodes'
[✔] EKS cluster "mywebsite-cluster" in "us-west-2" region is ready
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 172.20.0.1 <none> 443/TCP 72m
mywebsite-service LoadBalancer 172.20.203.140 a25f46cd53643416d9bb376462b33f80-02aa51afd469eb5d.elb.us-west-2.amazonaws.com 80:30759/TCP,443:31461/TCP 18m
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
# bind-address = 127.0.0.1
mysql> create user 'root'@'%' identified by 'Test1234';
Query OK, 0 rows affected (0.01 sec)
mysql> select user , host from mysql.user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
5 rows in set (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> drop user root@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> select user , host from mysql.user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)
$ mysql -h 192.168.11.6 -uroot -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.19 Homebrew
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> select user , host from mysql.user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| hayashier | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| rdsadmin | localhost |
+------------------+-----------+
5 rows in set (0.00 sec)
$ mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
$ mysqld_safe --skip-grant-tables
2020-05-01T01:13:38.6NZ mysqld_safe Logging to '/usr/local/var/mysql/186590cdc3ab.ant.amazon.com.err'.
2020-05-01T01:13:38.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY 'Test1234';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> CREATE TEMPORARY TABLE mysql.tmpUser SELECT * FROM mysql.user WHERE host="%" and user="root";
mysql> UPDATE mysql.tmpUser SET host="localhost" WHERE user = "root";
mysql> INSERT INTO mysql.user SELECT * FROM mysql.tmpUser;
mysql> drop user root@'%';