CMD常用命令17常用软件注册为Widows服务

1、Apache注册为Widows服务

httpd -k install

2、MySQL注册为Widows服务

mysqld --install MySQL --defaults-file="D:\MySQL\MySQL Server 5.1\my.ini"

3、PostgreSQL注册为Widows服务

pg_ctl.exe register -N "postgresql-8.4" -D "D:/PostgreSQL/8.4/data" -w

4、SVN注册为Widows服务

sc create svnserve binPath= "\"D:\Subversion\bin\svnserve.exe\" --service -r \"D:\Subversion\repository\"" displayname= "Subversion Service" depend= Tcpip start= auto 
sc start svnserve 
sc stop svnserve 
sc delete svnserve

5、redis注册为Widows服务

#loglevel 分为debug, notice, warning三级
redis-server.exe --service-install D:\Database\Redis2.8\db\redis.windows.conf --loglevel notice
redis-server --service-start
redis-server --service-stop
redis-server --service-uninstall

6、mongodb注册为Widows服务

mongod --dbpath=D:\Database\MongoDB3\db --logpath=D:\Database\MongoDB3\log\mongo.log --port 27027 --noauth --install -serviceName MongoDB01 --serviceDisplayName MongoDB01 
net start MongoDB01

FreeBSD10安装开发环境

1、安装JDK
1.1、Oracle没有为FreeBSD提供JDK环境,自带版本也挺高,那就安装默认的咯

pkg install jdk8

*在windows下编译过,超级大,时间也很久,实在不想编译openjdk了。

1.2、修改/etc/fstab文件,增加下面两行,搞定

# Device	Mountpoint	FStype	Options	Dump	Pass#
/dev/ada0p2	/		ufs	rw	1	1
/dev/ada0p3	none		swap	sw	0	0
fdesc		/dev/fd		fdescfs	rw	0	0
proc		/proc		procfs	rw	0	0

2、自己编译Ruby,当然也可以用pkg安装
2.1、下载并编译源码
ruby-lang.org

./configure --prefix=usr/ruby/ruby_2.2.3
make
make install

2.2、配置环境变量,默认为csh
编辑~/.cshrc

set RUBY_HOME=/usr/ruby/ruby_2.2.3
set path=($RUBY_HOME/bin $path)

重新登录一下。

2.3、切换为国内源

gem sources --add https://ruby.taobao.org/
gem sources --remove https://rubygems.org/
gem sources -l

2.4、安装gems

$ gem install rails
$ gem install redis

3、自己编译redis,当然也可以用pkg安装
3.1、下载并编译源码
redis.io

pkg install gmake
gmake
gmake PREFIX=/usr/redis/redis_3.0.4 install

3.2、配置环境变量,默认为csh
编辑~/.cshrc

set REDIS_HOME=/usr/redis/redis_3.0.4
set path=($REDIS_HOME/bin $path)

重新登录一下。

4、安装mongodb
4.1、下载并编译源码
mongodb.org

pkg install gcc
pkg install scons
pkg install python
pkg install libexecinfo

scons all
scons --prefix=/usr/mongodb/mongodb_3.0.7 install

*顺便说一下,这个编译后是18G,安装后为1.1G。。。
*如果你用的是3.0.7版本的源码,在FreeBSD下需要打补丁
github.com

4.2、配置环境变量,默认为csh
编辑~/.cshrc

set MONGODB_HOME=/usr/mongodb/mongodb_3.0.7
set path=($MONGODB_HOME/bin $path)

重新登录一下。

Virtualbox安装配置FreeBSD10

1、新建虚拟机,下载DVD镜像文件,安装虚拟机,整个过程比较简单:分区,选择需要的包,配置网络,配置用户
其中,我的虚拟机网卡配置为:
le0 是hostonly,用于与宿主机、其他虚拟机进行网络通许,要手工设置
le1 是nat,用于蹭网,设置为DHCP就好了

2、安装后重启,发现新用户不能su,将新用户添加到wheel组

#此命令一如既往的强大
bsdconfig

3、然后发现,le1发现可以连外网,但le0配置有些问题,编辑/etc/rc.conf

#network config
hostname="freebsd10"
ifconfig_le0="inet 172.16.172.5 netmask 255.255.0.0"
ifconfig_le1="DHCP"
ip6addrctl_enable="NO"
defaultrouter="10.0.3.2"
#static_routes="net1"
#route_net1="-net 172.16.172.0/16 172.16.172.1"

重启网络,OK。

4、找了一下,VirtualBox自带的扩展插件是没有BSD系统支持的,那就安装开源的呗
首先尝试了bsdconfig进行安装,但系统提示找不到数据库

bsdconfig
#选择Packages
no pkg(8) database found.

4.1A网上找了下,从DVD安装可以这样处理:

mount -t cd9660 /dev/cd0 /dist
env REPOS_DIR=/dist/packages/repos pkg search virtualbox
env REPOS_DIR=/dist/packages/repos pkg install virtualbox-ose-additions 

4.1B或者,直接采用网络安装可以这样处理:

pkg install virtualbox-ose-additions 

4.2安装后,需要在/etc/rc.conf中增加

vboxguest_enable=“YES”
vboxservice_enable=“YES”

重启

5、安装图形界面
从DVD安装可以这样处理:
5.1A

mount -t cd9660 /dev/cd0 /dist

env REPOS_DIR=/dist/packages/repos pkg search xorg
env REPOS_DIR=/dist/packages/repos pkg install xorg

env REPOS_DIR=/dist/packages/repos pkg search gnome
env REPOS_DIR=/dist/packages/repos pkg install gnome3

5.1B或者,直接采用网络安装可以这样处理:

pkg install xorg
pkg install gnome3

5.2A安装完毕后,如果想重启后直接进入图形界面,需要在/etc/rc.conf中增加

gdm_enable="YES"
gnome_enable="YES"

5.2B如果想重启后进入命令行界面,需要在/etc/rc.conf中增加

dbus_enable="YES"

然后,执行命令

echo exec gnome-session > ~/.xinitrc
startx

6、发现命令行界面分辨率太低
6.1查看系统支持的分辨率

#列出所有支持的分辨率
vidcontrol -i mode
#尝试1024x768x24
vidcontrol MODE_280

6.2在/etc/rc.conf中增加

allscreens_flags="MODE_280"

7、启动后,发现sendmail服务启动耗时很久,反正用不到,编辑/etc/rc.conf文件,禁用之

vi /etc/rc.conf
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

8、最终,我的/etc/rc.conf文件如下

#network config
hostname="freebsd10"
ifconfig_le0="inet 172.16.172.5 netmask 255.255.0.0"
ifconfig_le1="DHCP"
ip6addrctl_enable="NO"
defaultrouter="10.0.3.2"
#static_routes="net1"
#route_net1="-net 172.16.172.0/16 172.16.172.1"

#display config
vboxguest_enable="YES"
vboxservice_enable="YES"
allscreens_flags="MODE_280"
#gdm_enable="YES"
#gnome_enable="YES"

#other service config
sshd_enable="YES"
powerd_enable="YES"
moused_enable="YES"
dbus_enable="YES"

#"AUTO" to enable crash dumps, "NO" to disable crash dumps
dumpdev="AUTO"

#disapbled service
zfs_enable="NO"
sendmail_enable="NONE"
sendmail_outbound_enbale="NO"
sendmail_msp_queue_enable="NO"
sendmail_submit_enable="NO"

MongoDB副本集(Java)

还是蛮简单的,驱动把任务全部做掉了

package com.djhu.mongodb.test;

import java.util.Arrays;

import org.bson.Document;

import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;

public class ReplTest
{
	private static void testInsert() 
	{
		MongoClient mongoClient = new MongoClient(Arrays.asList(
				   new ServerAddress("172.16.172.4", 27017),
				   new ServerAddress("172.16.172.4", 27018),
				   new ServerAddress("172.16.172.4", 27019)));

		MongoDatabase db = mongoClient.getDatabase("test");
		MongoCollection collection = db.getCollection("person");
		
		Document doc = new Document();
		doc.put("name", "tuzi");
		doc.put("age", 27);
		doc.put("sex", "Female");
		collection.insertOne(doc);
	}

	public static void main(String[] args)
	{
		testInsert();
	}
}

如果遇到下面的错误,是因为用了localhost作为replSet的地址,重新config一下就好了

Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:519)
	at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:50)
	at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
	... 3 more
Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}, {address=localhost:27018, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}, {address=localhost:27019, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}, {address=localhost:27020, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}]
	at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:370)
	at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101)
	at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75)
	at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71)
	at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68)
	at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:175)
	at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:141)
	at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:72)
	at com.mongodb.Mongo.execute(Mongo.java:747)
	at com.mongodb.Mongo$2.execute(Mongo.java:730)
	at com.mongodb.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:482)
	at com.mongodb.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:277)
	at com.djhu.mongodb.test.ReplTest.testInsert(ReplTest.java:28)
	at com.djhu.mongodb.test.ReplTest.main(ReplTest.java:33)

Redis分片(Jedis)

Redis的分片技术一般是通过客户端或代理来实现的

1、用jedis实现分片的时候,服务端不需要做任何配置即可

package com.djhu.redis.test;

import java.util.ArrayList;
import java.util.List;

import redis.clients.jedis.JedisShardInfo;
import redis.clients.jedis.ShardedJedis;

public class JedisShardTest
{
	public static void main(String[] args)
	{
		List<JedisShardInfo> jedisShardInfoList = new ArrayList<JedisShardInfo>();
		jedisShardInfoList.add(new JedisShardInfo("172.16.172.4", 6379));
		jedisShardInfoList.add(new JedisShardInfo("172.16.172.4", 6380));

		ShardedJedis sharded = new ShardedJedis(jedisShardInfoList);
		sharded.set("key01", "a");
		sharded.set("key02", "b");
		sharded.set("key03", "c");
		sharded.set("key04", "d");
		sharded.set("key05", "e");
		
		System.out.println(sharded.get("key03"));
	}
}

2、用Jedis连接池实现分片

package com.djhu.redis.test;

import java.util.ArrayList;
import java.util.List;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisShardInfo;
import redis.clients.jedis.ShardedJedis;
import redis.clients.jedis.ShardedJedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.util.Hashing;
import redis.clients.util.Sharded;

public class JedisSharedFactory
{
	// 最大可用连接数,默认值为8,如果赋值为-1则表示不限制
	private static int MAX_TOTAL = 256;
	// 最大空闲连接数,默认值为8
	private static int MAX_IDLE = 32;
	// 最小空闲连接数
	private static int MIN_IDLE = 4;
	// 最大等待连接毫秒数,默认值为-1表示永不超时
	private static int MAX_WAIT = 3000;
	// 连接redis超时时间
	private static int TIMEOUT = 3000;
	// true表示验证连接
	private static boolean TEST_ON_BORROW = true;

	//连接池
	private static ShardedJedisPool jedisPool = null;
	public static void initJedisPool()
	{
		try
		{
			JedisPoolConfig config = new JedisPoolConfig();
			config.setMaxTotal(MAX_TOTAL);
			config.setMaxIdle(MAX_IDLE);
			config.setMinIdle(MIN_IDLE);
			config.setMaxWaitMillis(MAX_WAIT);
			config.setTestOnBorrow(TEST_ON_BORROW);
			
			List<JedisShardInfo> jedisShardInfoList = new ArrayList<JedisShardInfo>();
			jedisShardInfoList.add(new JedisShardInfo("172.16.172.4", 6379));
			jedisShardInfoList.add(new JedisShardInfo("172.16.172.4", 6380));
			jedisPool = new ShardedJedisPool(config, jedisShardInfoList,Hashing.MURMUR_HASH,Sharded.DEFAULT_KEY_TAG_PATTERN);
		} 
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	public synchronized static ShardedJedis getConnection()
	{
		try
		{
			if (jedisPool != null)
			{
				ShardedJedis resource = jedisPool.getResource();
				return resource;
			} else
			{
				return null;
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
			return null;
		}
	}

	public static void returnResource(final ShardedJedis jedis)
	{
		if (jedis != null)
		{
			jedis.close();
		}
	}
	
	public static void main(String[] args)
	{
		initJedisPool();
		ShardedJedis redis = getConnection();
		redis.set("key10", "j");
		redis.set("key11", "k");
		redis.set("key12", "l");
		redis.set("key13", "m");
		redis.set("key14", "n");
		
		System.out.print(redis.get("key12"));
		
		returnResource(redis);
	}
}

Jedis连接Redis3 Cluster

1、源码如下

package com.djhu.redis.test;

import java.util.Set;
import java.util.HashSet;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

public class JedisClusterTest
{
	public static void main(String[] args)
	{
		Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 6379));  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 6380));  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 6381));  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 6382));  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 6383));  
        jedisClusterNodes.add(new HostAndPort("172.16.172.4", 7384));  
        
		//JedisCluster cluster = new JedisCluster(jedisClusterNodes,3000,1000);
        JedisCluster cluster = new JedisCluster(jedisClusterNodes);
		cluster.set("key10", "j");
		cluster.set("key11", "k");
		cluster.set("key12", "l");
		cluster.set("key13", "m");
		cluster.set("key14", "n");
		
		System.out.println(cluster.get("key12"));
		
	}
}

2、如果遇到下面错误,主要是因为建立cluster时,ip用了127.0.0.1。用其他ip重建一下cluster,就可以解决了。

Exception in thread "main" redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException: Too many Cluster redirections?
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:34)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:68)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:85)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:68)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:85)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:68)
	at redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:29)
	at redis.clients.jedis.JedisCluster.set(JedisCluster.java:75)

Redis3配置Cluster

1、redis3的cluster是基于ruby的,所以要安装好ruby,然后安装redis的gem

gem install redis

2、然后配置6份redis,修改配置如下

节点
dbm6379 dbm6380 dbm6381 dbs6382 dbm6383 dbm6384
配置文件 dbm6379/conf/redis.conf dbm6380/conf/redis.conf dbm6381/conf/redis.conf dbs6382/conf/redis.conf dbm6383/conf/redis.conf dbm6384/conf/redis.conf
port 6379 6380 6381 6382 6383 6384
logfile “/home/neohope/DB/redis-3.0.4/cluster/dbm6379/logs/redis_log.log” “/home/neohope/DB/redis-3.0.4/cluster/dbm6380/logs/redis_log.log” “/home/neohope/DB/redis-3.0.4/cluster/dbm6381/logs/redis_log.log” “/home/neohope/DB/redis-3.0.4/cluster/dbm6382/logs/redis_log.log” “/home/neohope/DB/redis-3.0.4/cluster/dbm6383/logs/redis_log.log” “/home/neohope/DB/redis-3.0.4/cluster/dbm6384/logs/redis_log.log”
dir “/home/neohope/DB/redis-3.0.4/cluster/dbm6379/data” “/home/neohope/DB/redis-3.0.4/cluster/dbm6380/data” “/home/neohope/DB/redis-3.0.4/cluster/dbm6381/data” “/home/neohope/DB/redis-3.0.4/cluster/dbm6382/data” “/home/neohope/DB/redis-3.0.4/cluster/dbm6383/data” “/home/neohope/DB/redis-3.0.4/cluster/dbm6384/data”
cluster-enabled yes yes yes yes yes yes
cluster-config-file nodes-6379.conf nodes-6380.conf nodes-6381.conf nodes-6382.conf nodes-6383.conf nodes-6384.conf
cluster-node-timeout 15000 15000 15000 15000 15000 15000
cluster-migration-barrier 1 1 1 1 1 1
cluster-require-full-coverage yes yes yes yes yes yes

3、启动redis

#!/bin/sh
~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbm6379/conf/redis.conf & echo $! & ~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbm6380/conf/redis.conf & echo $! & ~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbm6381/conf/redis.conf & echo $! & ~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbs6382/conf/redis.conf & echo $! & ~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbs6383/conf/redis.conf & echo $! & ~/DB/redis-3.0.4/bin/redis-server ~/DB/redis-3.0.4/cluster/dbs6384/conf/redis.conf & echo $!

4、配置cluster

#!/bin/sh
#这里最好不要用127.0.0.1做地址
~/DB/redis-3.0.4/bin/redis-trib.rb create --replicas 1 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384      

5、测试redis cluster

~/DB/redis-3.0.4/bin/redis-cli -c -p 6379 
set key01 a
set key02 b
set key03 c
set key04 d
dbsize
keys *
get key03

6、关闭redis

#!/bin/sh
~/DB/redis-3.0.4/bin/redis-cli -p 6379 shutdown
~/DB/redis-3.0.4/bin/redis-cli -p 6380 shutdown
~/DB/redis-3.0.4/bin/redis-cli -p 6381 shutdown
~/DB/redis-3.0.4/bin/redis-cli -p 6382 shutdown
~/DB/redis-3.0.4/bin/redis-cli -p 6383 shutdown
~/DB/redis-3.0.4/bin/redis-cli -p 6384 shutdown

参考:
redis cluster tutorial

Debian8 Jessie修改Terminal分辨率

昨天安装了Debian8 Jessie,禁用了gdb以后,发现Terminal分辨率变的超级低。
用以前的方法调整了一下,发现搞不定了,搞了大半天,终于找到了靠谱的方案:

1、修改/etc/default/grub
找到

#GRUB_GFXMODE=XXXXXX

修改该行,并新增一行,最后效果为

GRUB_GFXMODE=1024x768x24
GRUB_GFXPAYLOAD_LINUX=1024x768x24

2、修改/etc/grub.d/00_header
找到

if [ "x${GRUB_GFXMODE}" = "x" ] ; then auto ; fi,

修改该行,并新增一行,最后效果为

if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=1024x768x24 ; fi
if [ "x${GRUB_GFXPAYLOAD}" = "x" ] ; then GRUB_GFXPAYLOAD=1024x768x24 ; fi

3、仍然是etc/grub.d/00_header
找到

set gfxmode=${GRUB_GFXMODE}

在其后新增一行,最后效果为

set gfxmode=${GRUB_GFXMODE}
set gfxpayload=${GRUB_GFXPAYLOAD}

4、更新grub并重启,搞定

update-grub2
reboot

5、感觉Debian8 Jessie的配置改变了好多。。。

Redis主从数据库(Shell)

1、基本配置如下

数据库 master slave01 slave02
配置文件 redis.master.conf redis.slave01.conf redis.slave02.conf
ip地址 localhost localhost localhost
端口 6379 6380 6381
logfile “D:/Database/Redis2.8/mirror/master/logs/redis_log.txt” “D:/Database/Redis2.8/mirror/slave01/logs/redis_log.txt” “D:/Database/Redis2.8/mirror/slave02/logs/redis_log.txt”
dir “D:/Database/Redis2.8/mirror/master/data/” “D:/Database/Redis2.8/mirror/slave01/data/” “D:/Database/Redis2.8/mirror/slave02/data/”
slaveof localhost 6379 localhost 6379
slave-serve-stale-data yes yes
slave-read-only yes yes
slave-priority 100 100
maxheap 1073741824 1073741824
heapdir D:\Database\Redis2.8\mirror\slave01\heap D:\Database\Redis2.8\mirror\slave02\heap

2、启动

redis-server.exe D:\Database\Redis2.8\mirror\redis.master.conf
redis-server.exe D:\Database\Redis2.8\mirror\redis.slave01.conf
redis-server.exe D:\Database\Redis2.8\mirror\redis.slave02.conf

3、测试

D:\Database\Redis2.8>redis-cli
127.0.0.1:6379> dbsize
(integer) 0
127.0.0.1:6379> set key01 a
OK
127.0.0.1:6379> exit

D:\Database\Redis2.8>redis-cli -p 6380
127.0.0.1:6380> get key01
"a"
127.0.0.1:6380> set key02 b
(error) READONLY You can't write against a read only slave.
127.0.0.1:6380> exit

D:\Database\Redis2.8>redis-cli -p 6381
127.0.0.1:6381> get key01
"a"
127.0.0.1:6381> set key02 b
(error) READONLY You can't write against a read only slave.
127.0.0.1:6381> exit

4、关闭

redis-cli -p 6380 shutdown
redis-cli -p 6381 shutdown
redis-cli -p 6379 shutdown