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,然后启动主从,主从 ...
随机推荐
- CKPT,SCN
CKPT进程:完全检查点 ckpt进程的作用,触发全局检查点,通过DBWR将buffer_cache中的所有脏块写入数据文件中:由于DBWR的机制,因此lgwr会先写,然后dbwr后写. 当完全检查点 ...
- 转:如何解决VC "应用程序无法启动,因为应用程序的并行配置不正确 sxstrace.exe"问题
如何解决VC "应用程序无法启动,因为应用程序的并行配置不正确 sxstrace.exe"问题 引用链接 http://blog.csdn.net/pizi0475/artic ...
- django所遇到问题简单总结
问题虽小,但却值得深思 一.改mysql密码 方法1: 用SET PASSWORD命令 首先登录MySQL. 格式:mysql> set password for 用户名@localhost = ...
- 虚拟机CentOS的NAT模式联网和SecureCRT远程登录管理工具
Cenos7 发生了很大的变化,不过也是直接配置网络,从启网卡,从启机器,crt链接 https://blog.csdn.net/gebitan505/article/details/54584213 ...
- C语言运算符优先级和ASCII表
1. C语言运算符优先级及结合性 优先级 运算符 名称或含义 使用形式 结合方向 说明 1 [] 数组下标 数组名[常量表达式] 左到右 -- () 圆括号 (表达式)/函数名(形参表) -- . 成 ...
- stenciljs 学习三 组件生命周期
stenciljs 组件包含好多生命周期方法, will did load update unload 实现生命周期的方法比价简单类似 componentWillLoad ....,使用typescr ...
- sql server CLR
1. 配置sql server 启用CLR 在SQL Server2005/2008里面,CLR默认是关闭的.可以使用如下SQL语句开启CLR. sp_configure 'show advanced ...
- Oracle密码过期处理
问题:Oracle密码过期导致数据库无法访问 解决方案: 1.后台以数据库管理员身份登陆,服务器中打开cmd命令,然后输入 sqlplus / as sysdba 2.查看用户对应的proifle文件 ...
- 前缀式计算 nyoj
题目描述 先说明一下什么是中缀式: 如2+(3+4)*5这种我们最常见的式子就是中缀式. 而把中缀式按运算顺序加上括号就是:(2+((3+4)*5)) 然后把运算符写到括号前面就是+(2 *( +(3 ...
- junit 知识点
JUnit 测试框架具有以下重要特性: 测试工具 测试套件 测试运行器 测试分类 测试工具 测试工具是一整套固定的工具用于基线测试.测试工具的目的是为了确保测试能够在共享且固定的环境中运行,因此保证测 ...