StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.73k stars 1.75k forks source link

Issue with reading data from StarRocks (allin1) using Flink SQL on Linux running on Windows10 virtual box #27308

Closed ChairmanArthur closed 7 months ago

ChairmanArthur commented 1 year ago

This was based on the following instructions: https://docs.starrocks.io/en-us/latest/unloading/Flink_connector

Instead of the StarRocks setup through VMs, I used the StarRocks allin1 on Docker instead, based on the following guide to set up and deploy StarRocks with Docker: https://docs.starrocks.io/en-us/latest/quick_start/deploy_with_docker

Instead of behaving as the expected behavior in the Flink connector guide, it returned several different errors after multiple attempts using different ports. I have already made sure to change and modify my etc/hosts file to include the IP and DNS names used for StarRocks allin1 as well before hands.

First it failed by trying connection with port 8030 on scan_url, which gave the following error:

[ERROR] Could not execute SQL statement. Reason: 
java.lang.RuntimeException: Failed to create brpc source:java.net.SocketTimeoutException: connect timed out

8040 connection failed as well:

[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 Not Found

8060 gives the following issue:

[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 [172.17.0.2:8060][E1002]Fail to find method on `/api/test/scoreboard_test00/_query_plan'

Steps to reproduce the behavior


Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-45-generic i686)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
Last login: Fri Jul 14 20:12:55 2023 from 192.168.1.19

ajh@ajh-VirtualBox:~/flink-1.15.4$ ./bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host ajh-VirtualBox.
Starting taskexecutor daemon on host ajh-VirtualBox.

ajh@ajh-VirtualBox:~/flink-1.15.4$ cd bin
ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ ./sql-client.sh

                                   ▒▓██▓██▒
                               ▓████▒▒█▓▒▓███▓▒
                            ▓███▓░░        ▒▒▒▓██▒  ▒
                          ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                          ██▒         ░▒▓███▒    ▒█▒█▒
                            ░▓█            ███   ▓░▒██
                              ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                            █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                            ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                         ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
                   ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
                  ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
                ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
               ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
              ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
           ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
           ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
           ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
           ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
          ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
          █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
          ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
          ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
           ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
           ▓█   ▒█▓   ░     █░                ▒█              █▓
            █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
             █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
              ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
               ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
                ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
                  ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                      ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░

    ______ _ _       _       _____  ____  _         _____ _ _            _  BETA
   |  ____| (_)     | |     / ____|/ __ \| |       / ____| (_)          | |
   | |__  | |_ _ __ | | __ | (___ | |  | | |      | |    | |_  ___ _ __ | |_
   |  __| | | | '_ \| |/ /  \___ \| |  | | |      | |    | | |/ _ \ '_ \| __|
   | |    | | | | | |   <   ____) | |__| | |____  | |____| | |  __/ | | | |_
   |_|    |_|_|_| |_|_|\_\ |_____/ \___\_\______|  \_____|_|_|\___|_| |_|\__|

        Welcome! Enter 'HELP;' to list all available commands. 'QUIT;' to exit.

Command history file path: /home/ajh/.flink-sql-history

Flink SQL> CREATE TABLE flink_testdb_00
> (
>     `id` INT,
>     `name` STRING,
>     `score` INT
> )
> WITH
> (
>     'connector'='starrocks',
>     'scan-url'='e547433b93f1:8030',
>     'jdbc-url'='jdbc:mysql://e547433b93f1:9030',
>     'username'='root',
>     'password'='',
>     'database-name'='test',
>     'table-name'='scoreboard_test00'
> );
[INFO] Execute statement succeed.

Flink SQL> SELECT id, name FROM flink_testdb_00 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Failed to create brpc source:java.net.SocketTimeoutException: connect timed out

Flink SQL> exit;
[INFO] Exiting Flink SQL CLI Client...

Shutting down the session...
done.

ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ telnet e547433b93f1 8030
Trying 192.168.1.19...
Connected to e547433b93f1.
Escape character is '^]'.
^]
telnet> ^C^C
quit
Connection closed by foreign host.

ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ ./sql-client.sh

                                   ▒▓██▓██▒
                               ▓████▒▒█▓▒▓███▓▒
                            ▓███▓░░        ▒▒▒▓██▒  ▒
                          ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                          ██▒         ░▒▓███▒    ▒█▒█▒
                            ░▓█            ███   ▓░▒██
                              ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                            █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                            ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                         ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
                   ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
                  ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
                ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
               ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
              ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
           ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
           ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
           ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
           ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
          ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
          █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
          ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
          ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
           ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
           ▓█   ▒█▓   ░     █░                ▒█              █▓
            █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
             █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
              ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
               ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
                ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
                  ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                      ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░

    ______ _ _       _       _____  ____  _         _____ _ _            _  BETA
   |  ____| (_)     | |     / ____|/ __ \| |       / ____| (_)          | |
   | |__  | |_ _ __ | | __ | (___ | |  | | |      | |    | |_  ___ _ __ | |_
   |  __| | | | '_ \| |/ /  \___ \| |  | | |      | |    | | |/ _ \ '_ \| __|
   | |    | | | | | |   <   ____) | |__| | |____  | |____| | |  __/ | | | |_
   |_|    |_|_|_| |_|_|\_\ |_____/ \___\_\______|  \_____|_|_|\___|_| |_|\__|

        Welcome! Enter 'HELP;' to list all available commands. 'QUIT;' to exit.

Command history file path: /home/ajh/.flink-sql-history

Flink SQL> DROP TABLE flink_testdb_00;
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.ValidationException: Table with identifier 'default_catalog.default_database.flink_testdb_00' does not exist.

Flink SQL> SHOW tables;
Empty set

Flink SQL> CREATE TABLE flink_testdb_00
> (
>     `id` INT,
>     `name` STRING,
>     `score` INT
> )
> WITH
> (
>     'connector'='starrocks',
>     'scan-url'='e547433b93f1:8060',
>     'jdbc-url'='jdbc:mysql://e547433b93f1:9030',
>     'username'='root',
>     'password'='',
>     'database-name'='test',
>     'table-name'='scoreboard_test00'
> );
[INFO] Execute statement succeed.

Flink SQL> SELECT id, name FROM flink_testdb_00 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Failed to get queryInfo:Connect to e547433b93f1:8060 [e547433b93f1/192.168.1.19] failed: Connection timed out (Connection timed out)

Flink SQL>
>
> SHOW tables;
+-----------------+
|      table name |
+-----------------+
| flink_testdb_00 |
+-----------------+
1 row in set

Flink SQL> CREATE TABLE flink_testdb_01
> (
>     `id` INT,
>     `name` STRING,
>     `score` INT
> )
> WITH
> (
>     'connector'='starrocks',
>     'scan-url'='e547433b93f1:8040',
>     'jdbc-url'='jdbc:mysql://e547433b93f1:9030',
>     'username'='root',
>     'password'='',
>     'database-name'='test',
>     'table-name'='scoreboard_test00'
> );
[INFO] Execute statement succeed.

Flink SQL> SELECT id, name FROM flink_testdb_01 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 Not Found

Flink SQL> exit;
[INFO] Exiting Flink SQL CLI Client...

Shutting down the session...
done.

ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ vi /etc/hosts
ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ sudo vi /etc/hosts
[sudo] password for ajh:

ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ ./sql-client.sh

                                   ▒▓██▓██▒
                               ▓████▒▒█▓▒▓███▓▒
                            ▓███▓░░        ▒▒▒▓██▒  ▒
                          ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                          ██▒         ░▒▓███▒    ▒█▒█▒
                            ░▓█            ███   ▓░▒██
                              ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                            █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                            ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                         ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
                   ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
                  ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
                ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
               ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
              ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
           ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
           ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
           ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
           ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
          ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
          █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
          ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
          ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
           ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
           ▓█   ▒█▓   ░     █░                ▒█              █▓
            █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
             █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
              ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
               ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
                ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
                  ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                      ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░

    ______ _ _       _       _____  ____  _         _____ _ _            _  BETA
   |  ____| (_)     | |     / ____|/ __ \| |       / ____| (_)          | |
   | |__  | |_ _ __ | | __ | (___ | |  | | |      | |    | |_  ___ _ __ | |_
   |  __| | | | '_ \| |/ /  \___ \| |  | | |      | |    | | |/ _ \ '_ \| __|
   | |    | | | | | |   <   ____) | |__| | |____  | |____| | |  __/ | | | |_
   |_|    |_|_|_| |_|_|\_\ |_____/ \___\_\______|  \_____|_|_|\___|_| |_|\__|

        Welcome! Enter 'HELP;' to list all available commands. 'QUIT;' to exit.

Command history file path: /home/ajh/.flink-sql-history

Flink SQL> SHOW tables;
Empty set

Flink SQL> CREATE TABLE flink_testdb00
> (
>     `id` INT,
>     `name` STRING,
>     `score` INT
> )
> WITH
> (
>     'connector'='starrocks',
>     'scan-url'='a22826981340:8060',
>     'jdbc-url'='jdbc:mysql://a22826981340:9030',
>     'username'='root',
>     'password'='',
>     'database-name'='test',
>     'table-name'='scoreboard_test00'
> );
[INFO] Execute statement succeed.

Flink SQL> SELECT id, name FROM flink_testdb00 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 [172.17.0.2:8060][E1002]Fail to find method on `/api/test/scoreboard_test00/_query_plan'

Flink SQL> SELECT id, name FROM flink_testdb00 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 [172.17.0.2:8060][E1002]Fail to find method on `/api/test/scoreboard_test00/_query_plan'

Flink SQL> exit;
[INFO] Exiting Flink SQL CLI Client...

Shutting down the session...
done.
ajh@ajh-VirtualBox:~/flink-1.15.4/bin$ ./sql-client.sh

                                   ▒▓██▓██▒
                               ▓████▒▒█▓▒▓███▓▒
                            ▓███▓░░        ▒▒▒▓██▒  ▒
                          ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                          ██▒         ░▒▓███▒    ▒█▒█▒
                            ░▓█            ███   ▓░▒██
                              ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                            █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                            ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                         ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
                   ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
                  ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
                ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
               ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
              ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
           ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
           ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
           ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
           ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
          ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
          █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
          ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
          ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
           ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
           ▓█   ▒█▓   ░     █░                ▒█              █▓
            █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
             █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
              ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
               ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
                ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
                  ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                      ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░

    ______ _ _       _       _____  ____  _         _____ _ _            _  BETA
   |  ____| (_)     | |     / ____|/ __ \| |       / ____| (_)          | |
   | |__  | |_ _ __ | | __ | (___ | |  | | |      | |    | |_  ___ _ __ | |_
   |  __| | | | '_ \| |/ /  \___ \| |  | | |      | |    | | |/ _ \ '_ \| __|
   | |    | | | | | |   <   ____) | |__| | |____  | |____| | |  __/ | | | |_
   |_|    |_|_|_| |_|_|\_\ |_____/ \___\_\______|  \_____|_|_|\___|_| |_|\__|

        Welcome! Enter 'HELP;' to list all available commands. 'QUIT;' to exit.

Command history file path: /home/ajh/.flink-sql-history

Flink SQL> CREATE TABLE flink_testdb00
> (
>     `id` INT,
>     `name` STRING,
>     `score` INT
> )
> WITH
> (
>     'connector'='starrocks',
>     'scan-url'='a22826981340:8060',
>     'jdbc-url'='jdbc:mysql://a22826981340:9030',
>     'username'='root',
>     'password'='',
>     'database-name'='test',
>     'table-name'='scoreboard_test00'
> );
[INFO] Execute statement succeed.

Flink SQL> SELECT id, name FROM flink_testdb00 WHERE score > 20;
[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 [172.17.0.2:8060][E1002]Fail to find method on `/api/test/scoreboard_test00/_query_plan'

Flink SQL>

Expected behavior

The expected behavior of this would be as depicted on the guide, where data is successfully read from StarRocks using Flink SQL.

Real behavior

Instead of behaving as the expected behavior in the guide, it returned several different errors after multiple attempts using different ports.

First it failed by trying connection with port 8030 on scan_url, which gave the following error:

[ERROR] Could not execute SQL statement. Reason: 
java.lang.RuntimeException: Failed to create brpc source:java.net.SocketTimeoutException: connect timed out

8040 connection failed as well:

[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 Not Found

8060 gives the following issue:

[ERROR] Could not execute SQL statement. Reason:
java.lang.RuntimeException: Request of get query plan failed with code 404 [172.17.0.2:8060][E1002]Fail to find method on `/api/test/scoreboard_test00/_query_plan'

StarRocks version

The StarRocks version used here is 3.1.0-rc01-64ca37e863

StarRocks > select current_version();
+-----------------------+
| current_version()     |
+-----------------------+
| 3.1.0-rc01-64ca37e863 |
+-----------------------+
1 row in set (0.04 sec)

Below are the code used on the Windows Command Prompt:

Microsoft Windows [Version 10.0.19045.3208]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Arthur>cd ..

C:\Users>cd ..

C:\>cd "Program Files"

C:\Program Files>cd MySQL

C:\Program Files\MySQL>cd "MySQL Server 5.5"

C:\Program Files\MySQL\MySQL Server 5.5>cd bin

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -P9030 -h192.168.1.19 -uroot --prompt="StarRocks > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 137
Server version: 5.1.0 3.1.0-rc01-64ca37e863

Copyright (c) 2000, 2018, 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.

StarRocks > USE test;
Database changed
StarRocks > CREATE TABLE `scoreboard_test00`
    -> (
    ->     `id` int(11) NOT NULL COMMENT "",
    ->     `name` varchar(65533) NULL DEFAULT "" COMMENT "",
    ->     `score` int(11) NOT NULL DEFAULT "0" COMMENT ""
    -> )
    -> ENGINE=OLAP
    -> PRIMARY KEY(`id`)
    -> COMMENT "OLAP"
    -> DISTRIBUTED BY HASH(`id`)
    -> PROPERTIES
    -> (
    ->     "replication_num" = "3"
    -> );
ERROR 1064 (HY000): Unexpected exception: Replication num should be less than the number of available BE nodes. Replication num is 3 available BE nodes is 1, You can change this default by setting the replication_num table properties.
StarRocks > CREATE TABLE `scoreboard_test00`
    -> (
    ->     `id` int(11) NOT NULL COMMENT "",
    ->     `name` varchar(65533) NULL DEFAULT "" COMMENT "",
    ->     `score` int(11) NOT NULL DEFAULT "0" COMMENT ""
    -> )
    -> ENGINE=OLAP
    -> PRIMARY KEY(`id`)
    -> COMMENT "OLAP"
    -> DISTRIBUTED BY HASH(`id`)
    -> PROPERTIES
    -> (
    ->     "replication_num" = "1"
    -> );
Query OK, 0 rows affected (0.34 sec)

StarRocks > INSERT INTO scoreboard_test00
    -> VALUES
    ->     (
    -> 1
    -> , 'Bob',
    -> 21
    -> ),
    ->     (
    -> 2
    -> , 'Stan',
    -> 21
    -> ),
    ->     (
    -> 3
    -> , 'Sam',
    -> 22
    -> ),
    ->     (
    -> 4
    -> , 'Tony',
    -> 22
    -> ),
    ->     (
    -> 5
    -> , 'Alice',
    -> 22
    -> ),
    ->     (
    -> 6
    -> , 'Lucy',
    -> 23
    -> ),
    ->     (
    -> 7
    -> , 'Polly',
    -> 23
    -> ),
    ->     (
    -> 8
    -> , 'Tom',
    -> 23
    -> ),
    ->     (
    -> 9
    -> , 'Rose',
    -> 24
    -> ),
    ->     (
    -> 10
    -> , 'Jerry',
    -> 24
    -> ),
    ->     (
    -> 11
    -> , 'Jason',
    -> 24
    -> ),
    ->     (
    -> 12
    -> , 'Lily',
    -> 25
    -> ),
    ->     (
    -> 13
    -> , 'Stephen',
    -> 25
    -> ),
    ->     (
    -> 14
    -> , 'David',
    -> 25
    -> ),
    ->     (
    -> 15
    -> , 'Eddie',
    -> 26
    -> ),
    ->     (
    -> 16
    -> , 'Kate',
    -> 27
    -> ),
    ->     (
    -> 17
    -> , 'Cathy',
    -> 27
    -> ),
    ->     (
    -> 18
    -> , 'Judy',
    -> 27
    -> ),
    ->     (
    -> 19
    -> , 'Julia',
    -> 28
    -> ),
    ->     (
    -> 20
    -> , 'Robert',
    -> 28
    -> ),
    ->     (
    -> 21
    -> , 'Jack',
    -> 29
    -> );
Query OK, 21 rows affected (1.54 sec)
{'label':'insert_7895e8c2-239a-11ee-b4f7-0242ac110002', 'status':'VISIBLE', 'txnId':'4006'}

StarRocks > SELECT * FROM scoreboard_test00;
+------+---------+-------+
| id   | name    | score |
+------+---------+-------+
|    1 | Bob     |    21 |
|    2 | Stan    |    21 |
|    4 | Tony    |    22 |
|    7 | Polly   |    23 |
|    8 | Tom     |    23 |
|   11 | Jason   |    24 |
|   13 | Stephen |    25 |
|   14 | David   |    25 |
|   16 | Kate    |    27 |
|   19 | Julia   |    28 |
|   21 | Jack    |    29 |
|    3 | Sam     |    22 |
|    5 | Alice   |    22 |
|    6 | Lucy    |    23 |
|    9 | Rose    |    24 |
|   10 | Jerry   |    24 |
|   12 | Lily    |    25 |
|   15 | Eddie   |    26 |
|   17 | Cathy   |    27 |
|   18 | Judy    |    27 |
|   20 | Robert  |    28 |
+------+---------+-------+
21 rows in set (0.10 sec)

StarRocks > SHOW PROC '/frontends'\G;
*************************** 1. row ***************************
             Name: e547433b93f1_9010_1689292099302
               IP: e547433b93f1
      EditLogPort: 9010
         HttpPort: 8030
        QueryPort: 9030
          RpcPort: 9020
             Role: LEADER
        ClusterId: 320856925
             Join: true
            Alive: true
ReplayedJournalId: 13612
    LastHeartbeat: 2023-07-16 05:45:59
         IsHelper: true
           ErrMsg:
        StartTime: 2023-07-16 05:05:03
          Version: 3.1.0-rc01-64ca37e863
1 row in set (0.14 sec)

ERROR:
No query specified

StarRocks > SHOW PROC '/backends'\G;
*************************** 1. row ***************************
            BackendId: 10004
                   IP: e547433b93f1
        HeartbeatPort: 9050
               BePort: 9060
             HttpPort: 8040
             BrpcPort: 8060
        LastStartTime: 2023-07-16 05:05:02
        LastHeartbeat: 2023-07-16 05:46:24
                Alive: true
 SystemDecommissioned: false
ClusterDecommissioned: false
            TabletNum: 56
     DataUsedCapacity: 35.111 KB
        AvailCapacity: 229.755 GB
        TotalCapacity: 250.982 GB
              UsedPct: 8.46 %
       MaxDiskUsedPct: 8.46 %
               ErrMsg:
              Version: 3.1.0-rc01-64ca37e863
               Status: {"lastSuccessReportTabletsTime":"2023-07-16 05:46:02"}
    DataTotalCapacity: 229.755 GB
          DataUsedPct: 0.00 %
             CpuCores: 8
    NumRunningQueries: 0
           MemUsedPct: 0.36 %
           CpuUsedPct: 0.3 %
1 row in set (0.01 sec)

ERROR:
No query specified

StarRocks > exit;
Bye

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -P9030 -h192.168.1.19 -uroot --prompt="StarRocks > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 100
Server version: 5.1.0 3.1.0-rc01-64ca37e863

Copyright (c) 2000, 2018, 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.

StarRocks > USE demo;
ERROR 1064 (HY000): Unknown database 'demo'
StarRocks > CREATE TABLE `scoreboard_test00`
    -> (
    ->     `id` int(11) NOT NULL COMMENT "",
    ->     `name` varchar(65533) NULL DEFAULT "" COMMENT "",
    ->     `score` int(11) NOT NULL DEFAULT "0" COMMENT ""
    -> )
    -> ENGINE=OLAP
    -> PRIMARY KEY(`id`)
    -> COMMENT "OLAP"
    -> DISTRIBUTED BY HASH(`id`)
    -> PROPERTIES
    -> (
    ->     "replication_num" = "1"
    -> );
ERROR 1064 (HY000): Getting analyzing error. Detail message: No database selected.
StarRocks > CREATE DATABASE test;
Query OK, 0 rows affected (0.17 sec)

StarRocks > USE test;
Database changed
StarRocks > CREATE TABLE `scoreboard_test00`
    -> (
    ->     `id` int(11) NOT NULL COMMENT "",
    ->     `name` varchar(65533) NULL DEFAULT "" COMMENT "",
    ->     `score` int(11) NOT NULL DEFAULT "0" COMMENT ""
    -> )
    -> ENGINE=OLAP
    -> PRIMARY KEY(`id`)
    -> COMMENT "OLAP"
    -> DISTRIBUTED BY HASH(`id`)
    -> PROPERTIES
    -> (
    ->     "replication_num" = "1"
    -> );
Query OK, 0 rows affected (0.06 sec)

StarRocks > INSERT INTO scoreboard_test00
    -> VALUES
    ->     (
    -> 1
    -> , 'Bob',
    -> 21
    -> ),
    ->     (
    -> 2
    -> , 'Stan',
    -> 21
    -> ),
    ->     (
    -> 3
    -> , 'Sam',
    -> 22
    -> ),
    ->     (
    -> 4
    -> , 'Tony',
    -> 22
    -> ),
    ->     (
    -> 5
    -> , 'Alice',
    -> 22
    -> ),
    ->     (
    -> 6
    -> , 'Lucy',
    -> 23
    -> ),
    ->     (
    -> 7
    -> , 'Polly',
    -> 23
    -> ),
    ->     (
    -> 8
    -> , 'Tom',
    -> 23
    -> ),
    ->     (
    -> 9
    -> , 'Rose',
    -> 24
    -> ),
    ->     (
    -> 10
    -> , 'Jerry',
    -> 24
    -> ),
    ->     (
    -> 11
    -> , 'Jason',
    -> 24
    -> ),
    ->     (
    -> 12
    -> , 'Lily',
    -> 25
    -> ),
    ->     (
    -> 13
    -> , 'Stephen',
    -> 25
    -> ),
    ->     (
    -> 14
    -> , 'David',
    -> 25
    -> ),
    ->     (
    -> 15
    -> , 'Eddie',
    -> 26
    -> ),
    ->     (
    -> 16
    -> , 'Kate',
    -> 27
    -> ),
    ->     (
    -> 17
    -> , 'Cathy',
    -> 27
    -> ),
    ->     (
    -> 18
    -> , 'Judy',
    -> 27
    -> ),
    ->     (
    -> 19
    -> , 'Julia',
    -> 28
    -> ),
    ->     (
    -> 20
    -> , 'Robert',
    -> 28
    -> ),
    ->     (
    -> 21
    -> , 'Jack',
    -> 29
    -> );
Query OK, 21 rows affected (2.79 sec)
{'label':'insert_7c158a9a-23a0-11ee-a8d3-0242ac110002', 'status':'VISIBLE', 'txnId':'2'}

StarRocks > SELECT * FROM scoreboard_test00;
+------+---------+-------+
| id   | name    | score |
+------+---------+-------+
|    3 | Sam     |    22 |
|    5 | Alice   |    22 |
|    6 | Lucy    |    23 |
|    9 | Rose    |    24 |
|   10 | Jerry   |    24 |
|   12 | Lily    |    25 |
|   15 | Eddie   |    26 |
|   17 | Cathy   |    27 |
|   18 | Judy    |    27 |
|   20 | Robert  |    28 |
|    1 | Bob     |    21 |
|    2 | Stan    |    21 |
|    4 | Tony    |    22 |
|    7 | Polly   |    23 |
|    8 | Tom     |    23 |
|   11 | Jason   |    24 |
|   13 | Stephen |    25 |
|   14 | David   |    25 |
|   16 | Kate    |    27 |
|   19 | Julia   |    28 |
|   21 | Jack    |    29 |
+------+---------+-------+
21 rows in set (0.10 sec)

StarRocks > select current_version();
+-----------------------+
| current_version()     |
+-----------------------+
| 3.1.0-rc01-64ca37e863 |
+-----------------------+
1 row in set (0.04 sec)

StarRocks >
kevincai commented 1 year ago

this is a known issue that the flink connector connects FE and FE returns a HTTP redirection with the internal address of the BE. you can make sure that http://e547433b93f1:8040 is reachable from outside the docker, (e.g., mapping the 8040 port to the host), and then try again. We will improve the allin1 docker to support this scenario.

kobebryantlin0 commented 1 year ago

您好,我是林恩伟,你发的邮件我已经收到。

Kimi-SH commented 1 year ago

I've received your email and will will reply to you as soon as possible after the vacation.————————————This is an auto reply email from QQ Mail.

DanJing-coder commented 1 year ago

您好,您的邮件已收到,我会尽快给你回复。

ChairmanArthur commented 1 year ago

this is a known issue that the flink connector connects FE and FE returns a HTTP redirection with the internal address of the BE. you can make sure that http://e547433b93f1:8040 is reachable from outside the docker, (e.g., mapping the 8040 port to the host), and then try again. We will improve the allin1 docker to support this scenario.

I tried verifying those ports already using telnet for 8030, 8040, and 8060, and they were all able to connect.

ajh@ajh-VirtualBox:~/flink-1.15.4$ telnet a22826981340 8030
Trying 192.168.1.19...
Connected to e547433b93f1.
ajh@ajh-VirtualBox:~/flink-1.15.4$ telnet a22826981340 8040
Trying 192.168.1.19...
Connected to e547433b93f1.
ajh@ajh-VirtualBox:~/flink-1.15.4$ telnet a22826981340 8060
Trying 192.168.1.19...
Connected to e547433b93f1.

The reason why it said connected to a different name is because of the way I modified etc/hosts, the two names points to the name ip address:

ajh@ajh-VirtualBox:~/flink-1.15.4$ sudo vim /etc/hosts
[sudo] password for ajh:

127.0.0.1       localhost
127.0.1.1       ajh-VirtualBox
192.168.1.19    e547433b93f1 a22826981340

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/hosts" 10L, 268C                                        1,1           All
kevincai commented 1 year ago

can you have a try with our formal release. starrocks/allin1-ubuntu:3.1.0?

github-actions[bot] commented 7 months ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!