cratedb 3.2.0进行安装
Cratedb下载地址:https://cdn.crate.io/downloads/releases/nightly/
cratedb官方文档手册:https://crate.io/docs/crate/reference/en/latest/
1.安装java
安装java,确保版本在1.8以上
[root@localhost ~]# java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
2.创建crate用户
因为cratedb不能在root用户下启动,所以需要创建非root用户,我这里创建crate用户
[root@localhost /]# useradd crate
[root@localhost /]# passwd crate
密码和用户名一致
3.配置crate环境变量
[crate@localhost ~]$ more .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/usr/local/java/jdk1.8.0_151
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PATH
[crate@local
4./etc/security/limits.conf 修改和sysctl修改
在该文件最后面添加如下两项,然后退出重新登录
* hard nofile 65536
* soft nofile 65536
[root@localhost /]# sysctl -w vm.max_map_count=262144
5.安装python3
步骤省略,可以参考
http://blog.chinaunix.net/uid-77311-id-5787558.html
6.准备安装目录
[root@localhost ~]# cd /
[root@localhost /]# mkdir cratedb
7.解压安装
[root@localhost soft]# tar -xvf crate-3.2.0-201809190203-616c19f.tar.gz
[root@localhost soft]# mv crate-3.2.0-201809190203-616c19f /cratedb/crate-3.2.0
[root@localhost /]# chown -R crate.crate /cratedb
8.修改配置文件crate.in.sh(cratedb用户下修改)
配置文件路径为: /cratedb/crate-3.2.0/bin/crate.in.sh
在该配置文件最开始添加如下两项(根据机器实际情况配置):
CRATE_MIN_MEM=2g
CRATE_MAX_MEM=2g
9.修改配置文件
network.bind_host: 192.168.1.129 network.publish_host: 192.168.1.129 network.host: 192.168.1.129 auth.host_based.enabled: true auth: host_based: config: 0: user: crate address: 192.168.1.81 method: trust 99: method: password # When trust based authentication is used, the server just takes the username # provided by the client as is without further validation. The HTTP # implementation extracts the username from the standard HTTP Basic Authentication # (`Authorization: Basic ...`) request header. In case the `Authorization` header is not set, # a default username can be specified as follows: auth: trust: http_default_user: crate |
10.启动
注意不能在root下启动
[root@localhost /]# su - crate
[crate@localhost bin]$ cd /cratedb/crate-3.2.0/bin
[crate@localhost bin]$./crate -d ##表示后台启动
11.登陆
发现3.2.0版本没有crash后台登陆了,只能通过界面的方式登陆,在IE栏输入:
http://192.168.1.129:4200
安装crash
curl -o crash https://cdn.crate.io/downloads/releases/crash_standalone_latest
chmod +x crash
crash --host 192.168.1.129
这里如下需要设置address为本机的ip地址
[crate@localhost cratedb]$ ./crash --host 192.168.1.118 CONNECT OK cr> CREATE USER devtest WITH (password='123456'); CREATE OK, 1 row affected (0.491 sec) cr> GRANT DQL TO devtest; GRANT OK, 1 row affected (0.022 sec) cr> GRANT DDL TO devtest; GRANT OK, 1 row affected (0.010 sec) cr> GRANT DML TO devtest; GRANT OK, 1 row affected (0.011 sec)
--------------------------------------------------------------------
CREATE USER devtest WITH (password='123456');
#赋予权限
GRANT DQL TO devtest;
GRANT DDL TO devtest;
GRANT DML TO devtest;
创建普通用户之后,在ie浏览器里就可以输入账号密码登陆了
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?