CK集群搭建

参考:https://blog.csdn.net/u013332124/article/details/122714966

ck集群搭建:

yum install -y yum-utils
yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
yum install -y clickhouse-server clickhouse-client

echo -ne """
192.168.7.27    ck27
192.168.7.28    ck28
192.168.7.29    ck29
192.168.7.30    ck30

""" > /etc/hosts

hostnamectl set-hostname ck27

systemctl stop firewalld
systemctl disable firewalld
yum install ntpdate -y
ntpdate cn.pool.ntp.org

下载,配置zookeeper,和jdk
tar -xzvf jdk-8u231-linux-x64.tar.gz
mv jdk1.8.0_231/ java

echo -ne '
export JAVA_HOME=/opt/java
export PATH=:$JAVA_HOME/bin:$PATH
' >> /etc/profile

source /etc/profile

cd /opt
tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
cd apache-zookeeper-3.7.1-bin/conf
cp zoo_sample.cfg zoo.cfg

mkdir /opt/zkdata
vi zoo.cfg

dataDir=/opt/zkdata

server.1=ck27:2888:3888
server.2=ck28:2888:3888
server.3=ck29:2888:3888

echo 1 > /opt/zkdata/myid

/opt/apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
/opt/apache-zookeeper-3.7.1-bin/bin/zkServer.sh status


yum install -y unixODBC libicudata
yum install -y libxml2-devel expat-devel libicu-devel

vi /etc/clickhouse-server/config.xml

<zookeeper incl="zookeeper" optional="true" />
<include_from>/etc/clickhouse-server/config.d/metrika.xml</include_from>

touch config.d/metrika.xml
<yandex>
    <remote_servers>
        <Cluster1>
            <shard>
                <internal_replication>true</internal_replication>
                <replica>
                    <host>ck27</host>
                    <port>9000</port>
                </replica>
            </shard>
            <shard>
                <replica>
                    <internal_replication>true</internal_replication>
                    <host>ck28</host>
                    <port>9000</port>
                </replica>
            </shard>
            <shard>
                <internal_replication>true</internal_replication>
                <replica>
                    <host>ck29</host>
                    <port>9000</port>
                </replica>
            </shard>
        </Cluster1>
    </remote_servers>
 
    <zookeeper>
        <node index="1">
            <host>ck27</host>
            <port>2181</port>
        </node>
        <node index="2">
            <host>ck28</host>
            <port>2181</port>
        </node>
        <node index="3">
            <host>ck29</host>
            <port>2181</port>
        </node>
    </zookeeper>
 
<macros>
  <shard>02</shard> 
  <replica>ck28</replica>
</macros>
<networks>
   <ip>::/0</ip>
</networks>
 
<clickhouse_compression>
<case>
   <min_part_size>10000000000</min_part_size>
   <min_part_size_ratio>0.01</min_part_size_ratio>
   <method>lz4</method>
</case>
</clickhouse_compression>
 
</yandex>






/etc/init.d/clickhouse-server start
/etc/init.d/clickhouse-server status
/etc/init.d/clickhouse-server stop
/opt/apache-zookeeper-3.7.1-bin/bin/zkServer.sh stop
/opt/apache-zookeeper-3.7.1-bin/bin/zkServer.sh start
/opt/apache-zookeeper-3.7.1-bin/bin/zkServer.sh status


	<ldap_servers>
		<kuancheng_ldap>
			<host>192.168.1.7</host>
			<port>389</port>
			<bind_dn>cn={user_name},ou=Horizon_user,ou=Horizon,dc=kuancheng,dc=com</bind_dn>
			<verification_cooldown>300</verification_cooldown>
			<enable_tls>no</enable_tls>		
		</kuancheng_ldap>
		
	</ldap_servers>

你可能感兴趣的:(大数据,OLAP,ClickHouse,数据库,大数据分析)