From d7891ec9cf1f5d7d62bc7d5c522b2a9ccf0ab26f Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Thu, 1 Aug 2019 15:27:32 +0300 Subject: [PATCH 1/3] Fix formula for new_size in WriteBufferFromVector(AppendModeTag). --- dbms/src/IO/WriteBufferFromVector.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dbms/src/IO/WriteBufferFromVector.h b/dbms/src/IO/WriteBufferFromVector.h index 46080e227f5..b6a6a226669 100644 --- a/dbms/src/IO/WriteBufferFromVector.h +++ b/dbms/src/IO/WriteBufferFromVector.h @@ -27,19 +27,20 @@ private: VectorType & vector; bool is_finished = false; + static constexpr size_t initial_size = 32; + static constexpr size_t size_multiplier = 2; + void nextImpl() override { if (is_finished) throw Exception("WriteBufferFromVector is finished", ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER); size_t old_size = vector.size(); - vector.resize(old_size * 2); + vector.resize(old_size * size_multiplier); internal_buffer = Buffer(reinterpret_cast(vector.data() + old_size), reinterpret_cast(vector.data() + vector.size())); working_buffer = internal_buffer; } - static constexpr size_t initial_size = 32; - public: WriteBufferFromVector(VectorType & vector_) : WriteBuffer(reinterpret_cast(vector_.data()), vector_.size()), vector(vector_) @@ -57,8 +58,11 @@ public: : WriteBuffer(nullptr, 0), vector(vector_) { size_t old_size = vector.size(); - vector.resize(std::max(vector.size() + initial_size, vector.capacity())); - set(reinterpret_cast(vector.data() + old_size), (vector.size() - old_size) * sizeof(typename VectorType::value_type)); + size_t size = (old_size < initial_size) ? initial_size + : ((old_size < vector.capacity()) ? vector.capacity() + : vector.capacity() * size_multiplier); + vector.resize(size); + set(reinterpret_cast(vector.data() + old_size), (size - old_size) * sizeof(typename VectorType::value_type)); } void finish() From ea98bd4ae27a841d5bd9a2c69d5fab37e9708dd3 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 3 Aug 2019 06:01:13 +0300 Subject: [PATCH 2/3] Avoid extra dependency in Compiler (used with compile = 1 setting) --- dbms/src/Interpreters/Compiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbms/src/Interpreters/Compiler.cpp b/dbms/src/Interpreters/Compiler.cpp index ee6845767e6..3b420b6acce 100644 --- a/dbms/src/Interpreters/Compiler.cpp +++ b/dbms/src/Interpreters/Compiler.cpp @@ -236,6 +236,9 @@ void Compiler::compile( " -fuse-ld=" << compiler_executable_root << INTERNAL_LINKER_EXECUTABLE " -fdiagnostics-color=never" + /// Do not use libgcc and startup files. The library will work nevertheless and we avoid extra dependency. + " -nodefaultlibs -nostartfiles" + #if INTERNAL_COMPILER_CUSTOM_ROOT /// To get correct order merge this results carefully: /// echo | clang -x c++ -E -Wp,-v - From da22e5f9a6a2b63b3aa7d2ff3753611023683d6c Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Sat, 3 Aug 2019 09:42:33 +0300 Subject: [PATCH 3/3] Added RPM packages to english docs (#6310) --- docs/en/getting_started/index.md | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index a07a7f646a7..8f6308cd0ab 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -22,7 +22,7 @@ To install official packages add the Yandex repository in `/etc/apt/sources.list deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` -If you want to use the most recent version, replace `stable` with `testing` (this is not recommended for production environments). +If you want to use the most recent version, replace `stable` with `testing` (this is recommended for your testing environments). Then run these commands to actually install packages: @@ -37,13 +37,25 @@ You can also download and install packages manually from here: are generated from official `deb` packages by Yandex and have byte-identical binaries. -* Packages from are built by independent company Altinity, but are used widely without any complaints. -* Or you can use Docker (see below). +```bash +sudo yum install yum-utils +sudo rpm --import https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG +sudo yum-config-manager --add-repo https://repo.yandex.ru/clickhouse/rpm/stable/x86_64 +``` + +If you want to use the most recent version, replace `stable` with `testing` (this is recommended for your testing environments). + +Then run these commands to actually install packages: + +```bash +sudo yum install clickhouse-server clickhouse-client +``` + +You can also download and install packages manually from here: . ### From Docker Image @@ -76,6 +88,13 @@ To start the server as a daemon, run: $ sudo service clickhouse-server start ``` +If you don't have `service` command, run as + +``` bash +$ sudo /etc/init.d/clickhouse-server start +``` + + See the logs in the `/var/log/clickhouse-server/` directory. If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml`.