Troubleshooting

    • Check firewall settings.
    • If you cannot access the repository for any reason, download packages as described in the article and install them manually using the command. You will also need the tzdata package.
    • The server is not running.
    • Unexpected or wrong configuration parameters.

    Check if server is runnnig

    Command:

    If the server is not running, start it with the command:

    1. $ sudo service clickhouse-server start

    Check logs

    The main log of clickhouse-server is in /var/log/clickhouse-server/clickhouse-server.log by default.

    If the server started successfully, you should see the strings:

    • <Information> Application: starting up. — Server started.
    • <Information> Application: Ready for connections. — Server is running and ready for connections.

    If start failed with a configuration error, you should see the <Error> string with an error description. For example:

    If you don’t see an error at the end of the file, look through the entire file starting from the string:

    1. <Information> Application: starting up.

    If you try to start a second instance of clickhouse-server on the server, you see the following log:

    If you don’t find any useful information in clickhouse-server logs or there aren’t any logs, you can view system.d logs using the command:

      Start clickhouse-server in interactive mode

      This command starts the server as an interactive app with standard parameters of the autostart script. In this mode prints all the event messages in the console.

      Check:

      • Docker settings.

        If you run ClickHouse in Docker in an IPv6 network, make sure that network=host is set.

      • Endpoint settings.

        Check listen_host and settings.

        ClickHouse server accepts localhost connections only by default.

      • Check protocol settings for the HTTP API.

      • Secure connection settings.

        Check:

        Use proper parameters while connecting. For example, use the port_secure parameter with clickhouse_client.

      • User settings.

        You might be using the wrong user name or password.

      If ClickHouse is not able to process the query, it sends an error description to the client. In the clickhouse-client you get a description of the error in the console. If you are using the HTTP interface, ClickHouse sends the error description in the response body. For example:

      1. $ curl 'http://localhost:8123/' --data-binary "SELECT a"
      2. Code: 47, e.displayText() = DB::Exception: Unknown identifier: a. Note that there are no tables (FROM clause) in your query, context: required_names: 'a' source_tables: table_aliases: private_aliases: column_aliases: public_columns: 'a' masked_columns: array_join_columns: source_columns: , e.what() = DB::Exception

      If you start with the stack-trace parameter, ClickHouse returns the server stack trace with the description of an error.

      You might see a message about a broken connection. In this case, you can repeat the query. If the connection breaks every time you perform the query, check the server logs for errors.

      You can use the clickhouse-benchmark utility to profile queries. It shows the number of queries processed per second, the number of rows processed per second, and percentiles of query processing times.