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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值