eventql部署过程
1. 环境准备
install cmake make automake autoconf zlib-devel libtool
yum install zlib-devel
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
2. 安装Clang
yum install epel-release
yum install clang
安装gcc
yum -y install gcc
yum -y install gcc-c++
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
3. 安装GCC v5.2+
sudo yum install centos-release-scl
sudo yum install devtoolset-4-gcc*
scl enable devtoolset-4 bash
-- 或者
yum groupinstall "Development Tools"
-- 或者
yum install gcc gcc-c++ kernel-devel
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
永久生效:
~/.bashrc or ~/.bash_profile
source scl_source enable devtoolset-4
echo "source /opt/rh/devtoolset-3/enable" >> /etc/bashrc
source /etc/bashrc
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
which gcc
gcc --version
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
4. 准备Eventql编译
a) tar -xzvf eventql-0.4.0-rc0.tgz
b) cd eventql-0.4.0-rc0
c) ./autogen.sh
d) ./configure
e) scl enable devtoolset-4 bash
f) make
g) make install
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
5. 安装vscode
rpm --import https://packages.microsoft.com/keys/microsoft.asc
sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
yum install code
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
6. Running EventQL
a) standalone mode
mkdir -p /var/evql/standalone
/usr/local/bin/evqld --standalone --datadir /var/evql/standalone
query:
/usr/local/bin/evql --database test
/usr/local/bin/evql -h localhost -p 9175 --database test
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
b) cluster Mode
1) 安装zookeeper
1.1) 解压缩 zookeeper-3.3.6.tar.gz https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
tar -zxvf zookeeper-3.3.6.tar.gz /opt
1.2) cd /opt/zookeeper-3.3.6/conf/
1.3) 复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:
cp zoo_sample.cfg zoo.cfg
1.4) 用 vim 打开 zoo.cfg 文件并修改其内容为如下:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
server.1=222.29.77.204:3888
1.5) .创建数据文件
cd /tmp
mkdir zookeeper
touch myid
vim myid
添加1 保存退出
1.6) 用 vim 打开 /etc/ 目录下的配置文件 profile:
vim /etc/profile
并在其尾部追加如下内容:
export ZOOKEEPER_HOME=/opt/calisapp/zookeeper-3.3.6/
export PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
1.7) 使 /etc/ 目录下的 profile 文件即可生效:
source /etc/profile
1.8) 启动 zookeeper 服务:
/opt/zookeeper-3.3.6/bin/zkServer.sh start
如打印如下信息则表明启动成功:
ZooKeeper JMX enabled by default
Using config:/opt/calisapp/zookeeper-3.3.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
1.9) 查询 zookeeper 状态:
zkServer.sh status
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
2) 创建配置文件
vim /etc/evqevqld.conf并添加以下内容
[cluster]
name=mycluster
coordinator=zookeeper
zookeeper_hosts=localhost:2181
allowed_hosts=0.0.0.0/0
[server]
client_auth_backend=trust
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
The cluster.name option contains the cluster name (you can run multiple EventQL clusters with a single coordinator). You may set the cluster name to whatever you want.
The cluster.coordinator option specifies that we are going to use zookeeper as our coordination service.
The cluster.zookeeper_hosts contains a comma separated list of zookeeper hosts to connect to.
For a full list of supported configuration options please refer to the Configuration page.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
3) 创建集群
/usr/local/bin/evqlctl -c /etc/evqld.conf cluster-create
或者
$ evqlctl cluster-create \
-C cluster.name=mycluster \
-C cluster.coordinator=zookeeper \
-C cluster.zookeeper_hosts=nue01.prod.fnrd.net:2181
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
4) 添加集群主机
/usr/local/bin/evqlctl -c /etc/evqld.conf cluster-add-server --server_name "node1"
/usr/local/bin/evqlctl -c /etc/evqld.conf cluster-add-server --server_name "node2"
/usr/local/bin/evqlctl -c /etc/evqld.conf cluster-add-server --server_name "node3"
/usr/local/bin/evqlctl -c /etc/evqld.conf cluster-add-server --server_name "node4"
note:
添加机器:
evqlctl cluster-add-server --server_name "nodeX"
evqlctl cluster-add-server \
-C cluster.name=mycluster \
-C cluster.coordinator=zookeeper \
-C cluster.zookeeper_hosts=nue01.prod.fnrd.net:2181 \
--server_name "nodeX"
移除机器:
evqlctl cluster-remove-server --server_name "nodeX" --soft
evqlctl cluster-remove-server --server_name "nodeX" --hard
evqlctl cluster-remove-server \
-C cluster.name=mycluster \
-C cluster.coordinator=zookeeper \
-C cluster.zookeeper_hosts=nue01.prod.fnrd.net:2181 \
--server_name "nodeX" \
--soft
evqlctl cluster-remove-server \
-C cluster.name=mycluster \
-C cluster.coordinator=zookeeper \
-C cluster.zookeeper_hosts=nue01.prod.fnrd.net:2181 \
--server_name "nodeX" \
--hard
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
5) 启动集群服务器
5.1) 创建数据目录(服务器使用)
mkdir /var/evql/node{1,2,3,4}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
5.2) 启动主机
/usr/local/bin/evqld -c /etc/evqld.conf -C server.name=node1 --listen localhost:9175 --datadir /var/evql/node1/
/usr/local/bin/evqld -c /etc/evqld.conf -C server.name=node2 --listen localhost:9176 --datadir /var/evql/node2/
/usr/local/bin/evqld -c /etc/evqld.conf -C server.name=node3 --listen localhost:9177 --datadir /var/evql/node3/
/usr/local/bin/evqld -c /etc/evqld.conf -C server.name=node4 --listen localhost:9178 --datadir /var/evql/node4/
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
5.3) 测试
创建数据库 /usr/local/bin/evqlctl -c /etc/evqld.conf database-create --database "mydb"
连接数据库 evql -h localhost -p 9175 -d mydb
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
指令集:
$ evql --help
Usage: $ evql [OPTIONS] [query]
$ evql [OPTIONS] -f file
-f, --file <file> Read query from file
-e, --exec <query_str> Execute query string
-l, --lang <lang> Set the query language ('sql' or 'js')
-D, --database <db> Select a database
-h, --host <hostname> Set the EventQL server hostname
-p, --port <port> Set the EventQL server port
-u, --user <user> Set the auth username
--password <password> Set the auth password (if required)
--auth_token <token> Set the auth token (if required)
-B, --batch Run in batch mode (streaming result output)
--history_file <path> Set the history file path
--history_maxlen <len> Set the maximum length of the history
-q, --quiet Be quiet (disables query progress)
--verbose Print debug output to STDERR
-v, --version Display the version of this binary and exit
-?, --help Display this help text and exit
Examples:
$ evql # start an interactive shell
$ evql -h localhost -p 9175 # start an interactive shell
$ evql < query.sql # execute query from STDIN
$ evql -f query.sql # execute query in query.sql
$ evql -l js -f query.js # execute query in query.js
$ evql -e 'SELECT 42;' # execute 'SELECT 42'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ evqlctl --help
Usage: $ evqlctl [OPTIONS] <command> [<args>]
-c, --config <file> Load config from file
-C name=value Define a config value on the command line
-?, --help <topic> Display a command's help text and exit
-v, --version Display the version of this binary and exit
Supported Commands:
cluster-create
Create a new cluster.
Usage: evqlctl cluster-create [OPTIONS]
cluster-add-server
Add a server to an existing cluster.
Usage: evqlctl cluster-add-server [OPTIONS]
--server_name The name of the server to add.
cluster-remove-server
Remove an existing server from an existing cluster.
Usage: evqlctl cluster-remove-server [OPTIONS]
--server_name The name of the server to remove.
--soft Enable the soft-leave operation.
--hard Enable the hard-leave operation.
cluster-status
Display the current cluster status.
Usage: evqlctl cluster-status [OPTIONS]
cluster-list
List the servers of the current cluster.
Usage:: evqlctl cluster-list
database-create
Create a new database.
Usage: evqlctl database-create [OPTIONS]
--database The name of the database to create.
table-split
Split a partition
Usage: evqlctl table-split [OPTIONS]
--database The name of the database.
--cluster_name The name of the cluster.
--table_name The name of the table to split.
--partition_id The id of the partition to split.
--split_point
table-config-set
Set table config parameters
Usage: evqlctl table-config-set [OPTIONS]
--database The name of the database to modify.
--table_name The name of the table to modify.
--param The parameter to set
--value The value to set the parameter to
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ evqld --help
Usage: $ evqld [OPTIONS]
-c, --config <file> Load config from file
-C name=value Define a config value on the command line
--standalone Run in standalone mode
--datadir <path> Path to data directory
--listen <host:port> Listen on this address (default: localhost:9175)
--daemonize Daemonize the server
--pidfile <file> Write a PID file
--loglevel <level> Minimum log level (default: INFO)
--[no]log_to_syslog Do[n't] log to syslog
--[no]log_to_stderr Do[n't] log to stderr
-?, --help Display this help text and exit
-v, --version Display the version of this binary and exit
Examples
$ evqld --standalone --datadir /var/evql
$ evqld -c /etc/evqld.conf --daemonize --pidfile /run/evql.pid
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
配置
配置搜索路径:
evqld /etc/evqld.conf
evql, evqlctl /etc/evql.conf
evql, evqlctl ~/.evql.conf
[client]
host = prod.example.com ; execute queries on this server
You can override every option set in the configuration file by using the command line option -C followed by the corresponding section.key=value pair.
evql -C client.host=localhost
Configuration Options
The EventQL configuration options are grouped in three sections: client, server and cluster.
Option Default Value Description
cluster.*
cluster.name — The name of the cluster
cluster.coordinator — The cluster coordinator service. Legal values: "zookeeper"
cluster.zookeeper_hosts — A comma-separated list of zookeeper hosts (only used when cluster.coordinator=zookeeper)
cluster.rebalance_interval 60000000
cluster.allowed_hosts — A comma-separated list of CIDR network ranges that are allowed to connect as internal nodes to the cluster. This setting does not affect which hosts are allowed to connect as a client. You can set this option to "0.0.0.0/0" to allow all hosts to connect as internal nodes.
cluster.allow_anonymous true Allow anonymous users to connect to the cluster Note: this does not circumvent client auth or any other ACLs. It merely controls if an anonymous user is even allowed to connect, let alone execute an operation.
cluster.allow_drop_table true If false, DROP TABLE is globally forbidden, regardless ACLs.
cluster.allow_create_database true If false, CREATE DATABASE is globally forbidden, regardless of ACLs.
server.*
server.datadir — The location of the EvenQL data directory (mandatory)
server.listen — The address (host:port) on which the server should listen. NOTE that this address is published to the coordinator service and must be a reachable by all other servers in the cluster. I.e. you can't use localhost or 0.0.0.0. (mandatory)
server.name — The name of the server (optional)
server.pidfile — If set, the server will write a pidfile to the provided path and aquire an exclusive lock on the pidfile. If the exclusive lock fails, the server will exit.
server.daemonize false
server.indexbuild_threads 2 The number of background compaction threads to start
server.replication_threads_max 4 The max number of background replication threads to start
server.client_auth_backend —
server.internal_auth_backend —
server.noleader false If set to true, this server will not partake in leader election
server.noalloc false If set to true, no partitions/data will be allocated to this server
server.gc_mode MANUAL
server.gc_interval 30000000
server.cachedir_maxsize 68719476736 Unit: Bytes
server.disk_capacity The maximum number of bytes that the server is allowed to write/use on disk. Unit is Bytes. This is an optional limit, if it is unset, the server will use the actual number of free bytes on disk as the limit. Even if the limit is set and allows using more disk space than is actually available, the server will use the (smaller) real limit.
server.loadinfo_publish_interval 15m
How often should the server publish it's current load info (i.e disk usage and other stats) to the cluster. Unit is microseconds. The load info is used when deciding on which server to allocate new chunks, so a shorter interval and therefore more up-to-date load info is usually better.
However, making the interval smaller will increase the load on the coordination service (e.g. ZooKeeper). The QPS to to the coordination service can be calculated using "num_servers / interval_in_s". So with the default value of 15 minutes and 1,000 servers we will have roughly 1 write QPS to Zookeeper (good). With 10,000 servers we have 10 write QPS (still okay).
server.load_limit_soft 0.95 This value controls the upper limit on a servers disk utilization. If the soft load limit was reached, now new partitions will be allocated on the server. (Default: 95%)
server.load_limit_hard 0.98 This value controls the upper limit on a servers disk utilization. If the soft load limit was reached, now new partitions will be allocated on the server and the cluster will slowly start to remove existing partitions from the server until the disk usage falls below the soft limit.
server.partitions_loading_limit_soft 4 The maximum number of partitions that can be loading on a server at the same time before allocations with priorty "IDLE" will stop being placed on the server. Allocations with priorty "BEST_EFFORT" or "MUST_ALLOCATE" may still be placed on the server even after the soft limit was reached.
server.partitions_loading_limit_hard 64 The maximum number of partitions that can be loading on a server at the same time before allocations with priorty "IDLE" and "BEST_EFFORT" will stop being placed on the server. Allocations with priority "MUST_ALLOCATE" may still be placed on the server even after the soft limit was reached.
server.c2s_io_timeout 60s How long should the server wait for data on a connection to a client when it expects the data to arrive immediately. (optional, unit: microseconds)
server.c2s_idle_timeout 30min How long should the server wait for new data on an idle connection to a client. An idle connection is a connection where no data is expected to arrive immediately. (optional, unit: microseconds)
server.s2s_io_timeout 10s How long should the server wait for data on a connection to another server when it expects the data to arrive immediately. (optional, unit: microseconds)
server.s2s_idle_timeout 10s How long should the server wait for new data on an idle connection to another server. An idle connection is a connection where no data is expected to arrive immediately. (optional, unit: microseconds)
server.s2s_pool_max_connections unlimited Limit how many (internal) connections each server should keep in its connection pool. Set this value to zero to turn off connection pooling.
server.s2s_pool_max_connections_per_host unlimited Limit how many (internal) connections each server should keep in its connection pool per each distinct remote endpoint.
server.s2s_pool_linger_timeout 1s Controls after which time an idle connection is removed (and closed) from the connection pool. Unit is microseconds.
server.http_io_timeout 1s Configures the HTTP I/O timeout. The timeout controls how long the server will wait for the client to send the next byte of the request while reading the http request as well as how long the server will wait for the client to read the next byte of the response while writing the response. (optional, unit: microseconds)
server.heartbeat_interval 1s How often should the server send a keepalive/heartbeat frame on a busy connection. Note that this value must be lower than the idle timeout and also puts a lower limit on the idle timeout that a connection client may choose. (optional, unit: microseconds)
server.query_progress_rate_limit 250ms How often should the server send a progress event. (optional, unit: microseconds)
server.query_max_concurrent_shards 256 The default maximum number of shards to be executed in parallel/ concurrently for a single query. In other words this setting limits the maximum parallelism for a query. You should consider increasing the value if you're running on more than 64 machines.
server.query_max_concurrent_shards_per_host 6 The default maximum number of shards to be executed on any given host for a single query.
server.query_failed_shard_policy tolerate The failed shard policy can either be "tolerate" or "error". If the value is "tolerate" failed shards will be ignore/excluded from the query result (the percentage of 'missing data' will be returned with each result). If the value is "error" any failed shard will result in a query error. Valid values: "tolerate", "error"
client.*
client.host localhost The hostname of the EventQL server
client.port 9175 The port of the EventQL server
client.database The database that should be used for following queries (optional)
client.user $USER Username to use when connecting to server (optional)
client.password Password to use when connecting to server (optional)
client.auth_token Auth-Token to use when connecting to server (optional)
client.timeout 60s Timeout to use when connecting to server (unit is microseconds)
client.history_file $HOME/.evql_history Where to write the interactive shell history file
client.history_maxlen 1024 Maximum number of entries in the interactive shell history file
eventql部署过程的更多相关文章
- hudson部署过程
hudson部署过程: java安装 http://developer.51cto.com/art/201504/470683.htm tomcat安装 http://blog.csdn.net/hu ...
- SCCM 2012 R2安装部署过程和问题(三)
上篇 SCCM 2012 R2安装部署过程和问题(二) 个人认为对于使用SCCM 2012的最重要的经验是耐心. SCCM采用分布式部署的架构,不同的站点角色可以部署在不同的服务器上,站点角色之间的通 ...
- SCCM 2012 R2安装部署过程和问题(二)
上篇:SCCM 2012 R2安装部署过程和问题(一) 在上篇我们已经完成了SCCM 2012 R2安装前的准备,其中有许多细节,关于数据库的准备和权限的设置是需要特别注意的.那么接下来我们开始安装S ...
- SCCM 2012 R2安装部署过程和问题(一)
在进行Windows Server 2012 R2虚拟化测试前,由于需要安装,部署和管理很多的服务器,自然会想到该如何提高效率和有效的管理.在Windows Server 2008的时代微软已经提供称 ...
- BeX5平台简明部署过程
http://wex5.com/cn/concise-deployment/ BeX5平台简明部署过程 该文章主要介绍BeX5平台开发完成后,资源部署至正式环境的过程. 一. 获取BeX5企业快速开发 ...
- 淘宝分布式 key/value 存储引擎Tair安装部署过程及Javaclient測试一例
文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...
- windows server 2008 R2 Enterprise 间实时同步之FreeFileSync 部署过程
WindowsServer间实时同步之FreeFileSync 部署过程 1. 实验主机信息 IP 操作系统 源目录 目标目录 10.155.0.80 Windows Server 2008 R2 D ...
- Tomcat_记一次tomcatwar包应用简单部署过程
记一次tomcat war包应用简单部署过程 by:授客 QQ:1033553122 1. 实践环境 Linux apache-tomcat-7.0.73 2. 实践步骤 # 解压tomcat压缩 ...
- centos6下redis cluster集群部署过程
一般来说,redis主从和mysql主从目的差不多,但redis主从配置很简单,主要在从节点配置文件指定主节点ip和端口,比如:slaveof 192.168.10.10 6379,然后启动主从,主从 ...
随机推荐
- iOS 工程自动化 - OCLint
前言 最近一直在做 iOS 工程自动化方向的事情,所以把自己研究和实践的内容进行记录并分享,希望能给大家一些帮助. 为什么要使用 OCLint 做为一个静态代码分析工具,我们引入 OCLint 的目的 ...
- Java面试通关要点汇总整理【终极版】
简历篇 请自我介绍 请介绍项目 基础篇 基本功 面向对象的特征 final, finally, finalize 的区别 int 和 Integer 有什么区别 重载和重写的区别 抽象类和接口有什么区 ...
- 使用Django+MySQL+Apache+Linux创建简单的博客
本教程基于慕课网<Django入门与实践>编写,基于CentOS 7 基础知识 什么是django? Django是一个基于Python的高级Web开发框架, 特点:高效,快速,高度集成( ...
- ubuntu16.04 中文输入法
https://blog.csdn.net/qq_21792169/article/details/53152700 在主文件夹目录即home目录,按快捷键Ctrl+H(显示隐藏文件),看到的.bas ...
- [UE4]虚幻4的智能指针
虚幻自己实现了一套智能指针系统,为了跨平台. 指针: 占用8个字节,4个字节的Object指针,4字节的引用计数控制器的指针, 引用计数控制器需要12字节, 一个C++的Object指针4字节,一个共 ...
- PNG文件结构
对于一个PNG文件来说,其文件头总是由位固定的字节来描述的,HEX: 89 50 4E 47 0D 0A 1A 0A 使用ultra打开一个png图片,结果如下: 其中第一个字节0x89超出了ASCI ...
- POJ3669解题报告(bfs)
POJ3669http://poj.org/problem?id=3669 很明显是一道bfs的题目 由于陨石的降临具有时刻性,所以地图是随时间变化的, 所以可以使用结构体来存储陨石下落的时刻以及位置 ...
- REST与RESTFul API最佳实践
我经常会面试一些做PHP的开发者,让我很奇怪的是,10个人总有8个多不知道什么是REST服务,甚至是没有听说过.但RESTFul API已经是现在互联网里对外开放接口的主流模式,可参考: 豆瓣API ...
- 使用Apriori进行关联分析(一)
大型超市有海量交易数据,我们可以通过聚类算法寻找购买相似物品的人群,从而为特定人群提供更具个性化的服务.但是对于超市来讲,更有价值的是如何找出商品的隐藏关联,从而打包促销,以增加营业收入.其中最经典的 ...
- 教你如何阅读Oracle数据库官方文档
< Ask Oracle官方原创 > Oracle 官方文档 数量庞大,而且往往没有侧重点,让oracle新手看起来很费力.但是,仍有很多Oracle使用者认为任何oracle学习资料都比 ...