In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Install the curl system package
# yum install-y curl
two。 Install clickhouse repositories
# curl-s https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh | bash
3. Query clickhouse package
# yum list 'clickhouse*'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Base: mirror.bit.edu.cnextras: mirror.bit.edu.cnupdates: mirror.bit.edu.cn
Available Packages
Clickhouse-client.x86_64 1.1.54343-1.el7 Altinity_clickhouse
Clickhouse-compressor.x86_64 1.1.54336-3.el7 Altinity_clickhouse
Clickhouse-debuginfo.x86_64 1.1.54343-1.el7 Altinity_clickhouse
Clickhouse-server.x86_64 1.1.54343-1.el7 Altinity_clickhouse
Clickhouse-server-common.x86_64 1.1.54343-1.el7 Altinity_clickhouse
Clickhouse-test.x86_64 1.1.54343-1.el7 Altinity_clickhouse4. Install clickhouse package
# yum install-y 'clickhouse*'
# yum list installed 'clickhouse*'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Base: mirror.bit.edu.cnextras: mirror.bit.edu.cnupdates: mirror.bit.edu.cn
Installed Packages
Clickhouse-client.x86_64 1.1.54343-1.el7 @ Altinity_clickhouse
Clickhouse-debuginfo.x86_64 1.1.54343-1.el7 @ Altinity_clickhouse
Clickhouse-server.x86_64 1.1.54343-1.el7 @ Altinity_clickhouse
Clickhouse-server-common.x86_64 1.1.54343-1.el7 @ Altinity_clickhouse
Clickhouse-test.x86_64 1.1.54343-1.el7 @ Altinity_clickhouse5. Start the database
# / etc/init.d/clickhouse-server restart
Start clickhouse-server service: Path to data directory in / etc/clickhouse-server/config.xml: / var/lib/clickhouse/
DONE
6. Connect to the database
# clickhouse-client
ClickHouse client version 1.1.54343.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.54343.
:)
:)
:) create database testdb
CREATE DATABASE testdb
Ok.
0 rows in set. Elapsed: 0.003 sec.
:)
:) use testdb
USE testdb
Ok.
0 rows in set. Elapsed: 0.001 sec.
:)
:) CREATE TABLE arrays_test (s String, arr Array (UInt8)) ENGINE = Memory
CREATE TABLE arrays_test
(
S String
Arr Array (UInt8)
)
ENGINE = Memory
Ok.
0 rows in set. Elapsed: 0.003 sec.
:)
) INSERT INTO arrays_test VALUES ('Hello', [1 Goodbye', 2]), (' Goodbye', [])
INSERT INTO arrays_test VALUES
Ok.
3 rows in set. Elapsed: 0.060 sec.
:)
:) SELECT * FROM arrays_test
SELECT *
FROM arrays_test
┌─ s ─┬─ arr ─┐
│ Hello │ [1mai 2] │
│ World │ [3, 4, 5] │
│ Goodbye │ [] │
└─┴─┘
3 rows in set. Elapsed: 0.003 sec.
:)
:) SELECT s, arr FROM arrays_test ARRAY JOIN arr
SELECT
S
Arr
FROM arrays_test
ARRAY JOIN arr
┌─ s ─┬─ arr ─┐
│ Hello │ 1 │
│ Hello │ 2 │
│ World │ 3 │
│ World │ 4 │
│ World │ 5 │
└─┴─┘
5 rows in set. Elapsed: 0.003 sec.
:)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
-LNMP + Discuz-system environment: RHEL6 x32 selinux and iptables disabled host role: 172.25.4
© 2024 shulou.com SLNews company. All rights reserved.