[root@server1 go]# vim /etc/profile
---==---==---==---==---==---==---==---==---==---==---==---==
export GOPATH=/usr/local/codis
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/bin
[root@server1 mnt]# source /etc/profile
[root@server1 mnt]# tar zxf go1.7rc6.linux-amd64.tar.gz -C /usr/local/
[root@server1 go]# vim hello.go
--------------------------------------------------------
package main
import "fmt"
func main(){
fmt.Printf("hello,world\n")
}
[root@server1 go]# go run hello.go
hello,world
Jdk安装与环境变量配置
[root@server5 mnt]# tar zxf jdk-7u79-linux-x64.tar.gz -C /usr/local/
[root@server5 mnt]# cd /usr/local/
[root@server5 local]# ln -s jdk1.7.0_79/ java ##创建链接,便于启动。另外,作升级处理时,只需将java链接到新版本
[root@server5 local]# vim /etc/profile
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
export JAVA_HOME=/usr/local/java ##java环境变量
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
[root@server5 local]# source /etc/profile
[root@server1 mnt]# tar zxf codis3.2.2-go1.8.5-linux.tar.gz -C /usr/local/
[root@server1 ~]# mkdir -p $GOPATH/src/github.com/CodisLabs
[root@server1 mnt]# unzip codis-release3.2.zip
[root@server1 mnt]# mv codis-release3.2 $GOPATH/src/github.com/CodisLabs/codis
[root@server1 mnt]# cd $GOPATH/src/github.com/CodisLabs/codis
[root@server1 codis]# ls
admin config Dockerfile Godeps pkg vendor
ansible deploy example Makefile README.md version
cmd doc extern MIT-LICENSE.txt scripts wandoujia_license.txt
[root@server1 codis]# yum install git autoconf gcc -y
[root@server1 codis]# make
[root@server1 codis]# cd admin/
[root@server1 admin]# ls ##codis自带脚本
codis-dashboard-admin.sh codis-proxy-admin.sh
codis-fe-admin.sh codis-server-admin.sh
[root@server1 ~]# cd $GOPATH/src/github.com/CodisLabs/codis
[root@server1 admin]# ./codis-dashboard-admin.sh start
/usr/local/codis/src/github.com/CodisLabs/codis/admin/../config/dashboard.toml
starting codis-dashboard ...
[root@server1 admin]# ./codis-proxy-admin.sh start
/usr/local/codis/src/github.com/CodisLabs/codis/admin/../config/proxy.toml
starting codis-proxy ...
集群配置
配置zookeeper:
[root@server1 ~]# tar -xzf zookeeper-3.4.6.tar.gz -C /usr/local/
[root@server1 ~]# vim /etc/profile
export GOPATH=/usr/local/codis
export GOROOT=/usr/local/go
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.6/
export PATH=$PATH:/usr/local/go/bin:$ZOOKEEPER_HOME/bin
[root@server1 ~]# source /etc/profile
[root@server1 ~]# cp /usr/local/zookeeper-3.4.6/conf/zoo_sample.cfg /usr/local/zookeeper-3.4.6/conf/zoo.cfg
[root@server1 ~]# vim /usr/local/zookeeper-3.4.6/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper/data
autopurge.snapRetainCount=500
autopurge.purgeInterval=24
clientPort=2181
[root@server1 ~]# mkdir -p /data/zookeeper/data
[root@server1 ~]# echo "1" > /data/zookeeper/data/myid
[root@server3 codis]# cat log/codis-dashboard.log.2017-10-19
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 10553
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
在组中创建实例失败:
http://redis.cn/topics/cluster-tutorial.html