基础服务安装:mall
#yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel(javaJDK环境)
#java -version
#yum install -y redis(redis缓存服务)
#yum install -y elasticsearch(elasticsearch服务)
#yum install -y nginx(Nginx服务)
#yum install -y mariadb mariadb-server(MairaDB服务)
4.安装zookeeper服务
#tar -zxvf zookeeper-3.4.14.tar.gz(将提供的zookeeper-3.4.14.tar.gz上传至云主机的/opt内)
#mv zoo_sample.cfg zoo.cfg(进入到zookeeper-3.4.14/conf目录下,将zoo_sample.cfg文件重命名为zoo.cfg)
#./.4.14/bin目录下,启动ZooKeeper服务)
#./zkServer.sh status(查看ZooKeeper状态)
5.安装kafka服务
#tar -zxvf kafka_2.11-1.1.1.tgz(将提供的kafka_2.11-1.1.1.tgz包上传到云主机的/opt目录下)
#./kafka-server-start.sh -daemon ../config/server.properties(进入到kafka_2.11-1.1.1/bin目录下,启动Kafka服务)
#jps(net -ntpl 查看Kafka是否成功启动)
6.启动数据库
修改数据库配置文件并启动MariaDB数据库,设置root用户密码为123456,并创建gpmall数据库,将提供的gpmall.sql上传至/root目录下导入
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
#systemctl start mariadb(启动数据库)
#mysql_secure_installation设置root用户的密码为123456
#(默认回车、y、123456、123456、y、n、y、y)
# mysql -uroot –p123456(登录数据库)
>grant all privileges on *.* to root@localhost identified by '123456' with grant option;
>grant all privileges on *.* to root@"%" identified by '123456' with grant option;(设置root用户权限)
>create database gpmall;(创建数据库gpmall)
>use gpmall;
>source /root/gpmall.sql(导入gpmall.sql文件)
退出数据库
#systemctl enable mariadb
7.启动redis
修改Redis配置文件,编辑/etc/redis.conf文件。
将bind 127.0.0.1这一行注释掉;将protected-mode yes 改为 protected-mode no。
启动redsi服务
#systemctl start redis
#systemctl enable redis
配置elasticsearch服务
#vi /etc/elasticsearch/elasticsearch.yml
在文件最上面加入3条语句
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-credentials: true
将如下4条语句前的注释符去掉,并修改network.host的IP为本机IP
cluster.name: my-application
node.name: node-1
network.host: 172.16.51.29
http.port: 9200
#systemctl start elasticsearch
#systemctl enable elasticsearch
启动nginx服务
#systemctl start nginx
#systemctl enable nginx