环境搭建    2019-05-06 06:51:53    72    0    0
## Install JDK cd /opt/ sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.ora
环境搭建    2019-05-06 06:51:53    59    0    0
yum install libnet libpcap libnet-devel libpcap-devel epel-release git clone https://github.com/snooda/net-speeder cd net-speeder chmod +x ./build.sh bash ./build.sh ./n
linux配置    2019-05-06 06:51:53    102    0    0
## 服务端配置 ### 安装NTP yum install ntp ### 修改ntp.conf #修改restrict default kod nomodify notrap nopeer noquery #允许任何IP的客户机都可以进行时间同步 restrict default nomodify #只允许10.15.62.*网段的客户
数据库 环境搭建    2019-05-06 06:51:53    110    0    0
## 安装postgresql sudo yum install postgresql-server postgresql ## 验证是否安装成功 sudo rpm -aq| grep postgres ## 初始化数据库 #/var/lib/pgsql/data service postgresql initdb ## 启动服务并设置为开机启动
环境搭建    2019-05-06 06:51:53    37    0    0

Install with the script

  1. Log into your machine as a user with sudo or root privileges.

  2. Make sure your existing yum packages are up-to-date.

    $ sudo yum update
  3. Run the Docker installation

环境搭建    2019-05-06 06:51:53    73    0    0

1.下载 subversion 

wget http://ftp.cuhk.edu.hk/pub/packages/apache.org/subversion/subversion-1.8.15.tar.gz​

2. 配置sqllite

下载,解压,重命名为sqlite-amalgamation,移到subsvn目录下

mv sqlite-amalgamation subversi
数据库 环境搭建    2019-05-06 06:51:53    57    0    0

1.安装httpd

下载并安装apr(Apache Portable Runtime )

tar zxvf apr-1.5.1.tar.gz 
./configure --prefix=/home/xxx/programs/apr
make
make install​


下载并安装apr-util

./configure --prefix=/home/xxx/programs/a
日志分析 环境搭建    2019-05-06 06:51:53    100    0    0

一、安装elasticsearch

下载解压启动
下载https://www.elastic.co/downloads/elasticsearch

然后编辑ES的配置文件:

vi config/elasticsearch.yml

修改以下配置项:

cluster.name=es_cluster
node.name=node0
path.data=/tmp/elasticsearch/data
path.logs=/tmp/elasticsearch/logs
#当前hostname或IP,我这里是centos2
network.host=centos2
network.port=9200​
 
其他的选项保持默认,然后启动ES:可以看到,它跟其他的节点的传输端口为9300,接受HTTP请求的端口为9200。
./elasticsearch -d -p pidfile
设置集群名节点名
./elasticsearch --cluster.name my_cluster_name --node.name my_node_name
 然后可以打开页面localhost:9200
 
安装Head插件(Optional):
./bin/plugin install mobz/elasticsearch-head
 
刚刚安装的head插件,它是一个用浏览器跟ES集群交互的插件,可以查看集群状态、集群的doc内容、执行搜索和普通的Rest请求等。现在也可以使用它打开localhost:9200/_plugin/head页面来查看ES集群状态.

二、安装Logstash

其实它就是一个收集器而已,我们需要为它指定Input和Output(当然Input和Output可以为多个)。由于我们需要把Java代码中Log4j的日志输出到ElasticSearch中,因此这里的Input就是Log4j,而Output就是ElasticSearch。
 
 
下载解压:
tar -zxvf logstash-2.1.1.tar.gz
cd logstash-2.1.1

编写配置文件(名字和位置可以随意,这里我放在config目录下,取名为log4j_to_es.conf):

mkdir config
vi config/file_to_es.conf

 

# For detail structure of this file
# Set:
storm 环境搭建    2019-05-06 06:51:53    142    0    0

Storm使用Zookeeper协调集群,由于Zookeeper并不用于消息传递,所以Storm给Zookeeper带来的压力相当低。大多数情况下,单个节点的Zookeeper集群足够胜任,不过为了确保故障恢复或者部署大规模Storm集群,可能需要更大规模节点的Zookeeper集群(对于Zookeeper集群的话,官方推荐的最小节点数为3个)。在Zookeeper集群的每台机器上完成以下安装部署步骤:

1)下载安装Java JDK.

2)根据Zookeeper集群的负载情况,合理设置Java堆大小,尽可能避免发生swap,导致Zookeeper性能下降。

3)下载后解压安装Zookeeper包.

4)根据Zookeeper集群节点情况,创建如下格式的Zookeeper配置文件zoo.cfg:

tickTime=2000
dataDir=/var/zookeeper/
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888​

 其中:

  1. dataDir指定Zookeeper的数据文件目录;
  2. server.id=host:port:port,id是为每个Zookeeper节点的编号,保存在dataDir目录下的myid文件中;
  3. zoo1~zoo3表示各个Zookeeper节点的hostname;
  4. 第一个port是用于连接leader的端口,第二个port是用于leader选举的端口。 

5)在dataDir目录下创建myid文件,文件中只包含一行,且内容为该节点对应的server.id中的id编号。

6)启动Zookeeper服务:

可以通过bin/zkServer.sh脚本启动Zookeeper服务。

7)通过Zookeeper客户端测试服务是否可用:

  通过bin/zkCli.sh脚本启动Zookeeper Java客户端。

 


配置文件参考:


数据库 环境搭建    2019-05-06 06:51:53    103    0    0

1.下载解压h2

2.根目录下新建.h2.server.properties

 webAllowOthers=true
 webPort=8082

3.导入导出

call CSVWRITE ( 'e://h2/articles.csv', 'SELECT * FROM articles' )
CREATE TABLE TEST AS SELECT * FROM CSVREAD('test.csv')​


7/9