One, add the hard drive
1> mount the new hard drive and enter the FDISK-L command to see the current disk information.
2> can see a second disk of SDB in addition to the current first hard drive, and then partition it with Fdisk/dev/sdb
3> Enter the fdisk command, enter H to see Help for the command, partition by n
4> here Input e is divided into logical partition, according to P is divided into the main partition, we want to divide the disk into primary partition is input P
5> here to enter the primary partition as the primary partition, because it is a new disk we enter one of the first primary partition
6>first cylinder is the number of starting disks to select the partition, which can be customized or not, the default is 1, if no special needs strongly recommend the default, that is, one partition (directly press ENTER)
7> Next is to define the size of the partition, if you press the default (press Enter) that is the use of all available storage amount, can also be the number of M or m units ending (uppercase M is large B meaning, if the input 1M is actually X8 8m space), here we first divided into a 1G space, so enter + 1024m
After 8>, enter W to write to the partition, waiting for the end
9> re-enter Fdisk-l can see we just divided a partition, and then use mkfs-t ext3-c/dev/sdb1 format, if there are multiple partitions can be sdb1 to SDB2 sdb3 ... And so on, you can see the name of each partition with Fdisk-l
10> Blue part is to write hard disk volume label, if you do not want to label can directly press ENTER, now partition well we use Mount mount the partition can be used, here I attach it to the MNT directory, you can also build a directory mount
11> to see if the partition size is the same as scheduled, use the df-th command to see the current mount partition and size, and see the partition we just divided.
12> if you want to automatically mount the partition each time the system restarts can modify the/etc/fstab file, in the last Add a section/dev/sdb1/www ext3 defaults 1 2 (format description:/DEV/SDB1 represents which partition ext3 is the partition's Format defaults is mounted when the parameters to be set (read-only, read-write, enable quota, etc.), input defaults include parameters (rw, dev, exec, auto, nouser, async), 1 is the use of dump whether to record, 0 is not. 2 is the boot check order, is the boot system file is 1, the other file system is 2, such as do not check for 0)
Second, the installation of Redis1> Installation
wget http://download.redis.io/redis-stable.tar.gz
Tar xvzf redis-stable.tar.gz
CD redis-stable
Make
2> Configuration
During the convenient period, the CP command is copied to the USR directory for operation.
CP redis-server/usr/local/bin/
CP redis-cli/usr/local/bin/
Then create a new directory, store the configuration file
Mkdir/etc/redis
Mkdir/var/redis
Mkdir/var/redis/log
Mkdir/var/redis/run
mkdir/var/redis/6379
Locate the profile template in the Redis solution directory and copy it to the following location.
CP redis.conf/etc/redis/6379.conf
Modify with vim command
Daemonize Yes
Pidfile/var/redis/run/redis_6379.pid
Logfile/var/redis/log/redis_6379.log
dir/var/redis/6379
Finally, run Redis:
$ redis-server/etc/redis/6379.conf
Third, installation Kafka1> Installing the JDK2> Installation Kafka
Go to download page: http://kafka.apache.org/downloads.html
3> Configuration
/bin start and Stop commands, and so on.
/config configuration file
/libs Class Library
4> Start and stop
1) Start Zookeeper server:
bin/zookeeper-server-start.sh Config/zookeeper.properties &
2) Start Kafka server:
bin/kafka-server-start.sh Config/server.properties &
3) Stop
bin/kafka-server-stop.sh
bin/zookeeper-server-stop.sh
5> single-Machine connectivity test
1) Run Producer:
bin/kafka-console-producer.sh--broker-list localhost:9092--topic test
The earlier version of Kafka,--broker-list localhost:9092 needs to be changed to--zookeeper localhost:2181
2) Run Consumer:
bin/kafka-console-consumer.sh--zookeeper localhost:2181--topic test--from-beginning
Enter the string on the producer side and return to see if the consumer side is displayed.
6> Distributed Connectivity Testing
1) Zookeeper server, Kafka server, producer are placed on the server Server1, the IP address is 192.168.1.10
The consumer is placed on the server server2 with an IP address of 192.168.1.12.
2) The consumer of the producer and Server2 running Server1, respectively,
bin/kafka-console-producer.sh--broker-list 192.168.1.10:9092--topic test
bin/kafka-console-consumer.sh--zookeeper 192.168.1.10:2181--topic test--from-beginning
3) In the console side of the producer input string, consumer reported connection refused error:
Broker, producer, and consumer are all registered to zookeeper, and the parameters of producer and consumer are explicitly specified. The problem is on the broker's configuration file server.properties:
On file server.properties
# Hostname The broker would bind to. If not set, the server would bind to all interfaces
#host. Name=localhost
The reason is that the host name is not specified, that is, 127.0.0.1,consumer to the broker to get the data there is a problem. Set to 192.168.1.10, restart the service just fine.
To install Redis and Kafka