安装过程参考以下博客:
http://blog.csdn.net/money9sun/article/details/71742127
http://www.cnblogs.com/wsl222000/p/6041835.html
http://www.bubuko.com/infodetail-2340523.html
1.安装java
yum install java-1.8.0-openjdk-headless.x86_64
2.安装epel-release
yum install epel-release
3.安装pwgen
yum install pwgen
4.安装mongodb
4.1 新建源:vim /etc/yum.repos.d/mongodb-org-3.2.repo
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
4.2 安装
yum install mongodb-org
4.3 注册启动项并启动
chkconfig --add mongod
systemctl daemon-reload
systemctl enable mongod.service
systemctl start mongod.service
5. 安装elasticsearch
5.1 rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
5.2 vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://packages.elastic.co/elasticsearch/5.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
5.3 yum install elasticsearch
5.4 vim /etc/elasticsearch/elasticsearch.yml
5.5 把 cluster.name 前面的# 去掉 然后 改成 cluster.name:graylog(这个名字可以自定义,但是要记住)
5.6 注册并启动服务
chkconfig --add elasticsearch
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl restart elasticsearch.service
5.7 测试: curl -X GET http://localhost:9200
{
"name" : "Tarantula",
"cluster_name" : "graylog",
"cluster_uuid" : "gXUTfeC3SmalE5bCUcCN6g",
"version" : {
"number" : "2.4.6",
"build_hash" : "5376dca9f70f3abef96a77f4bb22720ace8240fd",
"build_timestamp" : "2017-07-18T12:17:44Z",
"build_snapshot" : false,
"lucene_version" : "5.5.4"
},
"tagline" : "You Know, for Search"
}
6 安装Graylog2
6.1 rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-2.2-repository
6.2 yum install graylog-server
6.3 配置
生成密钥 : pwgen -N 1 -s 96 将生成的串保存下来生成密码: echo -n 123456 | shasum -a 25
6.4 vim /etc/graylog/server/server.conf
password_secret = 刚才生成的密钥字符串
root_password_sha2 = 刚才生成的密码字符串
root_timezone = Asia/Shanghai
web_listen_uri = http://0.0.0.0:9000/
rest_listen_uri = http://0.0.0.0:12900/
rest_transport_uri = http://192.168.0.59:12900/ #(IP就是服务器的IP)
elasticsearch_cluster_name = graylog #(和前面定义的cluster.name一致)
elasticsearch_shards = 1
elasticsearch_replicas = 0
allow_highlighting = true #(运行查询结果高亮)
6.5 加入服务并启动
chkconfig --add graylog-server
systemctl daemon-reload
systemctl enable graylog-server.service
systemctl start graylog-server.service7 访问 http://192.168.0.59:9000/ 就可以看到界面了
账号是 admin
密码是刚刚设置的 123456
8 附上操作过程