第一步:准备编译环境和下载源码
golang >= 1.8 采用:go version查看
python >= 2.7.5 采用:python --version命令查看
nodejs >= 4.0.0 采用:node -v命令查看 npm -v cnpm -v bower -v
第二步:编译源码
要点:
第一步:需要准备的软件版本清单版本
第二步:安装软件
Nodejs安装配置方法
sudo ln -s /opt/node-v0.12.10-linux-x86/bin/node /usr/local/bin/node
sudo ln -s /opt/node-v0.12.10-linux-x86/bin/npm /usr/local/bin/npm
cd ../bin ./node -v ./npm -v 测试是否成功
用软连接进行连接
安装cnpm和bower
npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo ln -s /usr/local/node/bin/cnpm /usr/local/bin/
npm install bower -g
sudo ln -s /usr/local/node/bin/bower /usr/local/bin/
5.测试方法
npm -v cnpm -v bower -v
Mongodb 安装配置方法
dbpath = /usr/local/mongodb/db
logpath = /usr/local/mongodb/logs/mongodb.log
port = 27017
fork = true
nohttpinterface = true
auth=true
bind_ip=0.0.0.0
nojournal=true
4.启动/停止 mongodb 服务:
在bin下执行启动:mongod -f mongodb.conf
在bin下执行停止:mongod -f ./mongodb.conf --shutdown
输出结果如下:代表成功
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
about to fork child process, waiting until server is ready for connections.
forked process: 2428
child process started successfully, parent exiting
5.配置系统变量(事例:)
vi /etc/profile
export MONGODB_HOME=/usr/local/mongodb
export PATH=$PATH:$MONGODB_HOME/bin
$source /etc/profile
要点:
Redis 安装配置方法
protected-mode yes 改为protected-mode no daemonize设置为yes
ln -s /usr/local/redis/src/redis-server /usr/bin/redis-server
ln -s /usr/local/redis/src/redis-cli /usr/bin/redis-cli
5.启动/停止Redis
启动:redis-server /usr/local/redis/redis.conf
停止:redis-cli shutdown
6.设置密码
Zookeeper 安装配置方法
先安装JDK
vi /etc/profile
export JAVA_HOME=/usr/local/jdk1.8/
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
部署zookeeper
#############修改如下#################
# 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.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/logs
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
server.1=192.168.40.41:2888:3888
5.设置环境变量sudo vi /etc/profile 并source /etc/profile
ZOOKEEPER_HOME=/usr/local/zookeeper
export PATH=$ZOOKEEPER_HOME/bin:$PATH
6.关闭防火墙:systemctl stop firewalld.service
7. 安装好了,切换到bin目录,启动
要点:
启动客户端脚本:zkCli.sh -server 127.0.0.1:2181
第三步:部署源码(事例)
1 python init.py
2 python init.py --discovery 127.0.0.1:2181 --database cmdb --redis_ip 127.0.0.1 --redis_port 6379 --redis_pass 123456 --mongo_ip 127.0.0.1 --mongo_port 27017 --mongo_user cc --mongo_pass cc --blueking_cmdb_url http://127.0.0.1:8083 --listen_port 8083
3 ./start.sh
4 bash ./init_db.sh
5 http://192.168.5.56:8083
6 ./stop.sh
整个操作要点: