Skip to content

Commit 2d7f2b6

Browse files
committed
update
1 parent f4ef286 commit 2d7f2b6

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

docker/docker_yum.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
## Docker配置yum源,yum安装Docker 2017-03-13
3+
## http://www.aqzt.com
4+
5+
## robert yu
6+
## redhat 7
7+
8+
tee /etc/yum.repos.d/docker.repo <<-'EOF'
9+
[dockerrepo]
10+
name=Docker Repository
11+
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
12+
enabled=1
13+
gpgcheck=1
14+
gpgkey=https://yum.dockerproject.org/gpg
15+
EOF
16+
17+
yum install -y docker-engine
18+
service docker start
19+
chkconfig docker on

epel/epel_redhat.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
## redhat7.2配置yum源 2017-03-13
3+
## http://www.aqzt.com
4+
5+
## robert yu
6+
## redhat 7
7+
8+
yum update
9+
yum install -y wget
10+
rpm -aq|grep yum|xargs rpm -e --nodeps
11+
rpm -aq|grep python-iniparse|xargs rpm -e --nodeps
12+
wget http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm
13+
wget http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
14+
wget http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
15+
wget http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
16+
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
17+
rpm -ivh *.rpm
18+
mkdir -p /tmp/repo
19+
mv /etc/yum.repos.d/*.repo /tmp/repo/
20+
21+
###7.3.1611这个版本需查看163源上的URL地址确定
22+
sed -i 's/$releasever/7.3.1611/g' CentOS7-Base-163.repo
23+
cat CentOS7-Base-163.repo > /etc/yum.repos.d/rhel-debuginfo.repo
24+
yum clean all
25+
yum install -y epel-release

kafka/Kafka_zk_python.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
## python安装ZooKeeper模块 2017-03-14
3+
## http://www.aqzt.com
4+
5+
## robert yu
6+
## centos 6
7+
## python安装ZooKeeper模块,连接ZooKeeper,显示kafka节点
8+
9+
yum install -y wget gcc gcc-c++ libffi-devel python-devel openssl-devel
10+
##yum -y install libxml2 libxml2-dev libxslt* zlib gcc openssl
11+
12+
wget http://mirrors.hust.edu.cn/apache/zookeeper/stable/zookeeper-3.4.9.tar.gz
13+
wget https://pypi.python.org/packages/14/38/a761465ab0a154405c11f7e5d6e81edf6e84584e114e152fddd340f7d6d3/zkpython-0.4.2.tar.gz
14+
15+
tar zxvf zookeeper-3.4.9.tar.gz
16+
cd zookeeper-3.4.9/src/c
17+
./configure && make && make install
18+
19+
cd ../../../
20+
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/lib
21+
tar xzvf zkpython-0.4.2.tar.gz
22+
cd zkpython-0.4.2
23+
python setup.py install
24+
25+
#注:这种安装方式可能遇到以下错误:
26+
#找不到zookeeper.h头文件 可以调整setup.py 中include_dirs 路径的指向】
27+
#import zookeeper时 报 库文件缺失 可以
28+
#export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/lib:(指定缺失库文件位置) 】
29+
30+
#另一种安装zkpython方式
31+
#pip install zkpython
32+
#如果安装过程中报没有权限,则使用sudo pip install zkpython即可解决。
33+
34+
#测试python的zookeeper模块
35+
#python
36+
#import zookeeper
37+
#如果报错,请在.bashrc文件中加入
38+
#export LD_LIBRARY_PATH=/usr/local/lib/
39+
40+
#测试python的zookeeper模块
41+
#python
42+
#import zookeeper as zoo
43+
# 初始化连接到集群
44+
# zk = zoo.init("127.0.0.1:2181")
45+
# 获取所有节点
46+
# zoo.get_children(zk, "/", None)
47+
48+
##Python安装PIL出现command 'gcc' failed with exit status 1错误
49+
##这个错误一般有两个原因导致:
50+
## 1. gcc python-devel 没装,或只上了一个,解决:yum install -y wget gcc gcc-c++ libffi-devel python-devel
51+
## 2. zookeeper-3.4.9/src/c里面没有编译,进到这个目录执行:./configure && make && make install
52+
53+
54+
55+
56+
57+

0 commit comments

Comments
 (0)