eventql部署过程

时间:2022-09-03 21:08:48

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部署过程的更多相关文章

  1. hudson部署过程

    hudson部署过程: java安装 http://developer.51cto.com/art/201504/470683.htm tomcat安装 http://blog.csdn.net/hu ...

  2. SCCM 2012 R2安装部署过程和问题(三)

    上篇 SCCM 2012 R2安装部署过程和问题(二) 个人认为对于使用SCCM 2012的最重要的经验是耐心. SCCM采用分布式部署的架构,不同的站点角色可以部署在不同的服务器上,站点角色之间的通 ...

  3. SCCM 2012 R2安装部署过程和问题(二)

    上篇:SCCM 2012 R2安装部署过程和问题(一) 在上篇我们已经完成了SCCM 2012 R2安装前的准备,其中有许多细节,关于数据库的准备和权限的设置是需要特别注意的.那么接下来我们开始安装S ...

  4. SCCM 2012 R2安装部署过程和问题(一)

    在进行Windows Server 2012 R2虚拟化测试前,由于需要安装,部署和管理很多的服务器,自然会想到该如何提高效率和有效的管理.在Windows Server 2008的时代微软已经提供称 ...

  5. BeX5平台简明部署过程

    http://wex5.com/cn/concise-deployment/ BeX5平台简明部署过程 该文章主要介绍BeX5平台开发完成后,资源部署至正式环境的过程. 一. 获取BeX5企业快速开发 ...

  6. 淘宝分布式 key&sol;value 存储引擎Tair安装部署过程及Javaclient測试一例

    文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...

  7. windows server 2008 R2 Enterprise 间实时同步之FreeFileSync 部署过程

    WindowsServer间实时同步之FreeFileSync 部署过程 1. 实验主机信息 IP 操作系统 源目录 目标目录 10.155.0.80 Windows Server 2008 R2 D ...

  8. Tomcat&lowbar;记一次tomcatwar包应用简单部署过程

    记一次tomcat war包应用简单部署过程 by:授客 QQ:1033553122 1.  实践环境 Linux apache-tomcat-7.0.73 2.  实践步骤 # 解压tomcat压缩 ...

  9. centos6下redis cluster集群部署过程

    一般来说,redis主从和mysql主从目的差不多,但redis主从配置很简单,主要在从节点配置文件指定主节点ip和端口,比如:slaveof 192.168.10.10 6379,然后启动主从,主从 ...

随机推荐

  1. Hibernate中的session对象update方法的使用

    使一个游离对象转变为持久化对象.例如以下代码在session1中保存了一个Customer对象,然后在session2中更新这个Customer对象: Customer customer = new ...

  2. VS2008中MFC界面编程Caption中文全是乱码的解决办法 -转载

    一.问题 在预览状态下可能看到中文,但是编译运行后对话框中的中文全是问号.即使你用的VS中文版,即使你也用了Unicode编码,即使有条件编译 #ifdef _WIN32LANGUAGE LANG_C ...

  3. myeclipse10 如何把代码预览的窗口去掉

    1,选择菜单: windows -> preferences2,在弹出窗口中选择General-> Editors -> FileAssociations3,在上方框内选择*.jsp ...

  4. J2SE知识点摘记&lpar;二十四&rpar;

     覆写hashCode() 在明白了HashMap具有哪些功能,以及实现原理后,了解如何写一个hashCode()方法就更有意义了.当然,在HashMap中存取一个键值对涉及到的另外一个方法为equa ...

  5. HDU 2227 Find the nondecreasing subsequences&lpar;DP&rpar;

    Problem Description How many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3 ...

  6. WPF星空效果

    效果 前阵子看到ay的蜘蛛网效果和知乎的登录页背景,觉得效果很酷.自己也想写一个.于是写着写着就变成这样了.少女梦幻的赶脚有木有.我这有着一颗少女心的抠脚大汉 实现思路 分为两个部分: 1.星星无休止 ...

  7. intellij-添加文档注释模板

    file-->setting-->Editor-->File and Code Templates-->FileHeader

  8. Linux下安装MQ

    1.下载Linux下MQ的安装包,网上下载试用版或购买正版,此处以7.0.0.0版为例安装 2.如上图所示,是linux的MQ安装包展开图 3.创建用户和用户组 >root用户连接linux & ...

  9. Scala进阶之路-正则表达式案例

    Scala进阶之路-正则表达式案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 废话不多说,正则大家都很清楚,那在Scala如何使用正则了?我们直接上个案例,如下: /* @au ...

  10. springboot配置il8n

    springMvc下,配置il8n: 1.配置ResourceBundleMessageSource管理国际化资源文件 2.在页面使用fmt标签取出国际化内容 springBoot下,自动配置了il8 ...