发布于 2024-05-24   79人围观   0条评论

安装

根据官方文档安装即可

https://clickhouse.com/docs/zh/getting-started/install

使用其中 RPM

配置

  1. vim /etc/clickhouse-server/config.xml

修改 http[s] 端口 => 18123

  1. # http端口
  2. <http_port>8123</http_port>
  1. # tcp 端口
  2. 修改端口 9000 => 19000

开放外网访问

  1. vim /etc/clickhouse-server/config.xml
  2. ## 取消注释
  3. <listen_host>0.0.0.0</listen_host>

防火墙
firewall-cmd --add-port=19000/tcp --permanent
firewall-cmd --add-port=18123/tcp --permanent

重新加载防火墙配置

firewall-cmd --reload

修改 default 密码

生成密码密文

  1. PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD";
  2. echo -n "$PASSWORD" | sha256sum | tr -d '-'

第一行是密码明文,第二行是密码密文

  1. touch /etc/clickhouse-server/users.xml

https://github.com/ClickHouse/ClickHouse/blob/master/programs/server/users.xml 复制粘贴,不用重启,实时生效

  1. <clickhouse>
  2. <!-- See also the files in users.d directory where the settings can be overridden. -->
  3. <!-- Profiles of settings. -->
  4. <profiles>
  5. <!-- Default settings. -->
  6. <default>
查看更多
发布于 2023-12-17   50人围观   0条评论


查看更多
发布于 2023-09-23   88人围观   0条评论

golang

launch.json

  1. {
  2. // Use IntelliSense to learn about possible attributes.
  3. // Hover to view descriptions of existing attributes.
  4. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5. "version": "0.2.0",
  6. "configurations": [
  7. {
  8. "name": "Launch Package",
  9. "type": "go",
  10. "request": "launch",
  11. "mode": "auto",
  12. // "program": "${fileDirname}",
  13. "program": "${workspaceFolder}/main.go",
  14. "cwd": "${workspaceFolder}",
  15. // "debugAdapter": "dlv-dap",
  16. "debugAdapter": "legacy",
  17. // "showLog": true,
  18. // "trace": "verbose",
  19. // "logOutput": "dap",
  20. // "stopOnEntry": true,
  21. // "env": {
  22. // "HOME": "/mnt/hdd_00_09/home_repository/ResearchDev",
  23. // "GOPATH": "/mnt/hdd_00_09/workspace/ResearchDev/go",
  24. // "GOROOT":
查看更多
发布于 2023-08-17   81人围观   0条评论

环境

节点名 IP
kafka01 10.15.4.244
kafka02 10.15.4.245
kafka03 10.15.4.138
依赖 版本
Linux Server Centos 9
ZooKeeper 3.8.1
kafka 3.5.0

部署

每个节点均需操作

创建相关目录

  1. mkdir /root/kafka
  2. mkdir /root/kafka/logs

下载 kafka

  1. # https://downloads.apache.org/kafka/3.5.1/kafka_2.13-3.5.1.tgz
  2. cd /root/kafka
  3. wget https://downloads.apache.org/kafka/3.5.0/kafka_2.13-3.5.0.tgz
  4. tar zxvf kafka_2.13-3.5.0.tgz

修改配置

  1. cd /root/kafka/kafka_2.13-3.5.0
  2. vim config/server.properties
  3. # 修改以下内容
  4. log.dirs=/root/kafka/logs
  5. zookeeper.connect=10.15.4.244:2181,10.15.4.245:2181,10.15.4.138:2181
  6. # 分节点配置
  7. # 配置在节点 0 上
  8. broker.id=0
  9. listeners=PLAINTEXT://10.15.4.244:9092
  10. # 配置在节点 1 上
  11. broker.id=1
  12. listeners=PLAINTEXT://10.15.4.245:9092
  13. # 配置在节点 2 上
  14. broker.id=2
  15. listeners=PLAINTEXT://10.15.4.138:9092
  16. # 以提供其他生产、消费程序的远程端口连接
  17. # host.name=128.1.136.129
  18. # 让 topic 可以真的删除
  19. delete.topic.enable=true
  20. # 禁止 consumer 或者 producer 使用时自动创建
  21. auto.create.topics.enable=
查看更多
发布于 2023-06-30   90人围观   0条评论

环境

节点名 IP
zk01 10.15.4.244
zk02 10.15.4.245
zk03 10.15.4.138
依赖 版本
Linux Server Centos 9
JDK yum install java-11-openjdk
ZooKeeper 3.8.1

部署

每个节点均需操作

创建相关目录

  1. mkdir /root/zookeeper
  2. mkdir /root/zookeeper/data
  3. mkdir /root/zookeeper/logs

下载 zookeeper

  1. cd /root/zookeeper
  2. wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.8.1/apache-zookeeper-3.8.1-bin.tar.gz
  3. tar zxvf apache-zookeeper-3.8.1-bin.tar.gz

修改环境变量

  1. vim ~/.bashrc
  2. # 添加以下下内容
  3. # zookeeper
  4. export ZOOKEEPER_HOME=/root/zookeeper/apache-zookeeper-3.8.1-bin
  5. export PATH=$ZOOKEEPER_HOME/bin:$PATH
  6. # 使环境变量生效
  7. source ~/.bashrc

新建配置文件

  1. cd /root/zookeeper/apache-zookeeper-3.8.1-bin/conf
  2. touch zoo.cfg
  3. # 添加以下内容
  4. tickTime=2000
  5. initLimit=10
  6. syncLimit=5
  7. dataDir=/root/zookeeper/data
  8. dataLogDir=/root/zookeeper/logs
  9. clientPort=2181
  10. server.1=10.15.4.244:2888:3888
  11. server.2=10.15.4.245:2888:3888
  12. server.3=10.15.4.138:2888:3888
查看更多