环境准备
linux版本 Centos7:
系统最大打开文件句柄数
cat etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
关闭交换分区(swap)
swapoff -a
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
检查文件系统
df -hT |grep "ext4"
GCC版本(>=4.8.2)
gcc -v
# gcc version 4.8.5 2015062
JAVA版本(>=1.8)
java -version
# java version "1.8.0_202"
确认cpu是否支持avx2
cat /proc/cpuinfo | grep avx2
安装
下载
cd /data/software/
wget https://apache-doris-releases.oss-accelerate.aliyuncs.com/apache-doris-2.0.3-bin-x64.tar.gz
tar zxvf apache-doris-2.0.3-bin-x64.tar.gz
cd cd apache-doris-2.0.3-bin-x64
ll
mkdir /data/doris5306
mv * /data/doris5306/
安装fe
修改fe.conf
cd /data/doris5306/fe
vim conf/fe.conf
#修改以下项
http_port = 5030
rpc_port = 5020
query_port = 5306
edit_log_port = 5010
priority_networks = *.*.*.0/24
启动
./bin/start_fe.sh --daemon
验证
netstat -an |grep 5306
tail -200f log/fe.log
ps -ef |grep doris5306
netstat -anpt |grep {进程号}
# 如果启动不了,看日志:排除java环境问题,端口被占用
# 有些机器可能需要手动指定 $DORIS_HOME 这个变量
vim conf/fe.conf
vim bin/start_fe.sh
#DORIS_HOME="/data/doris5306/fe"
停止
sh bin/stop_fe.sh
安装be
修改be.conf
# cd /data/doris5306/be
# vim conf/be.conf
priority_networks = 10.25.16.0/24
be_port = 5160
webserver_port = 5140
heartbeat_service_port = 5150
brpc_port = 5260
启动
./bin/start_be.sh --daemon
#如果有报错 max_map_count:
sysctl -w vm.max_map_count=2000000
vim /etc/sysctl.conf
加集群
mysql -h 127.0.0.1 -P 5306 -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show frontends\G;
*************************** 1. row ***************************
Name: fe_2e4de06c_fde0_4ce7_8560_11da267f1fbb
Host: 10.*.*.*
EditLogPort: 5010
HttpPort: 5030
QueryPort: 5306
RpcPort: 5020
Role: FOLLOWER
IsMaster: true
ClusterId: 1757269789
Join: true
Alive: true
ReplayedJournalId: 2729
LastHeartbeat: 2023-12-25 19:34:04
IsHelper: true
ErrMsg:
Version: doris-2.0.3-rc06-37d31a5
CurrentConnected: Yes
1 row in set (0.07 sec)
ERROR:
No query specified
mysql> SHOW BACKENDS\G
Empty set (0.01 sec)
mysql> ALTER SYSTEM ADD BACKEND "10.*.*.*:9050";
Query OK, 0 rows affected (0.03 sec)
mysql> SHOW BACKENDS\G
*************************** 1. row ***************************
BackendId: 13800
Host: 10.*.*.*
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: NULL
LastHeartbeat: NULL
Alive: false
SystemDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
TrashUsedCapcacity: 0.000
AvailCapacity: 1.000 B
TotalCapacity: 0.000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
RemoteUsedCapacity: 0.000
Tag: {"location" : "default"}
ErrMsg:
Version:
Status: {"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
HeartbeatFailureCounter: 0
NodeRole:
1 row in set (0.02 sec)
停止
./bin/stop_be.sh
建库,建表
create database dbtest;
use dbtest;
CREATE TABLE csv_data (
account VARCHAR(255) NOT NULL COMMENT '',
name VARCHAR(255) NOT NULL default '' COMMENT '姓名',
organization VARCHAR(500) DEFAULT '' COMMENT '部门',
gender smallint NOT NULL default '-1' COMMENT '性别',
practice_status varchar(10) not null default '' COMMENT '',
political_affiliation VARCHAR(50) DEFAULT ''COMMENT '政治面貌',
education_degree VARCHAR(255) DEFAULT '' COMMENT '学历学位',
email VARCHAR(255) DEFAULT '' COMMENT '邮箱',
origin VARCHAR(255) DEFAULT '' COMMENT '来源'
)
ENGINE=OLAP
UNIQUE KEY(account)
DISTRIBUTED BY HASH(account) BUCKETS 16
;
CREATE USER 'dba' IDENTIFIED BY 'your_passwd';
grant all on *.* to dba;
CREATE USER 'dbtest_w' IDENTIFIED BY 'your_passwd';
GRANT ALL ON dbtest TO dbtest_w;
>> Home