博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64
阅读量:6303 次
发布时间:2019-06-22

本文共 18465 字,大约阅读时间需要 61 分钟。

首先要阅读requirement, 结合你的环境, 满足日后的使用, 需要合理的选择硬件, 以及需要的依赖组件或库.
需要注意一下数据库大小的估算.
数据库里存放的数据包括, 配置信息, 历史数据, 报告数据(趋势数据), 事件数据.
这些数据量的评估, 首先和每秒server接收到的数据量有关, 例如我们配置了3000个监控条目, 每60秒监控一次, 那么每秒将受到3000/60=50条监控数据, 
监控数据和监控配置有关, 可能存储的是数字, 或者字符串, 或者其他的值, 假设平均50个字节一条.
那么存放1年的历史数据需要50*24*60*60*365*50 bytes=73GB.
统计数据是指统计每小时的最大, 最小, 平均, COUNT值. 假设一个条目每小时需要128字节来存储统计信息. 
同样假设有3000个监控条目, 那么存储1年的统计数据需要3000*24*365*128=16.8GB
最后是事件的存储, 事件指触发的事件, 这个比较难估算, 最坏来算每秒产生1个事件, 一个事件存储消耗130个字节, 那么保存3年的事件需要空间3*24*60*60*365*130=12.3GB

安装过程 : 
下载稳定版本源码包
zabbix-2.2.6.tar.gz

阅读安装说明

1. 创建用户和组, 所有的zabbix daemon必须以普通用户运行来避免风险. 如果以root用于运行, 会自动切换到zabbix下运行. 如果以普通用户运行, 则
以运行daemon的普通用户运行. 除了不要以root来运行, 同时不要以有特权的任何普通用户运行daemon.
注意1: Running Zabbix as root, bin, or any other account with special rights is a security risk.
注意2: 如果server和agent在同一台机器的话, 务必使用不同的用户启动两个daemon, 因为如果使用同一个用户启动的话, agent很容易获取到server的配置文件, 所以建议使用不同的用户运行agent和server, 来分离权限.
[root@150 zabbix-2.2.6]# useradd zabbix[root@150 zabbix-2.2.6]# id zabbixuid=501(zabbix) gid=502(zabbix) groups=502(zabbix)
如果同主机还需要运行agent, 建议再创建一个用户.
[root@150 soft_bak]# useradd zagent[root@150 soft_bak]# id zagentuid=502(zagent) gid=503(zagent) groups=503(zagent)
2. 创建数据库, zabbix server, proxy, WEB需要l连接数据库, agent不需要连接数据库.
同时zabbix server需要在数据库中生成一些数据, 而proxy只需要结构.
我们这里选用PostgreSQL 9.3.5, 编译安装一个, 安装过程和初始化数据库的过程略.
useradd postgrestar -jxvf postgresql-9.3.5.tar.bz2cd postgresql-9.3.5./configure --prefix=/opt/pgsql9.3.5 --with-pgport=5432 --with-perl --with-tcl --with-python --with-openssl --with-pam --with-ldap --with-libxml --with-libxslt --enable-thread-safetygmake world && gmake install-worldln -s /opt/pgsql9.3.5 /opt/pgsqlvi /etc/profileexport PATH=/opt/pgsql/bin:$PATHexport MANPATH=/opt/pgsql/share/man:$MANPATHexport LD_LIBRARY_PATH=/opt/pgsql/lib:$LD_LIBRARY_PATHmkdir -p /data03/pgdata/pg_rootchown postgres:postgres /data03/pgdata/pg_rootsu - postgresvi .bash_profileexport PS1="$USER@`/bin/hostname -s`-> "export PGPORT=5432export PGDATA=/data03/pgdata/pg_rootexport LANG=en_US.utf8export PGHOME=/opt/pgsqlexport LD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATHexport DATE=`date +"%Y%m%d%H%M"`export PATH=$PGHOME/bin:$PATH:.export MANPATH=$PGHOME/share/man:$MANPATHexport PGUSER=postgresexport PGHOST=$PGDATAalias rm='rm -i'alias ll='ls -lh'export PGDATABASE=postgresinitdb -D $PGDATA -E UTF8 --locale=C -U postgres -Wcd $PGDATAvi postgresql.conflisten_addresses = '0.0.0.0'            # what IP address(es) to listen on;port = 5432                             # (change requires restart)max_connections = 500                   # (change requires restart)superuser_reserved_connections = 13     # (change requires restart)unix_socket_directories = '.'   # comma-separated list of directoriesunix_socket_permissions = 0700          # begin with 0 to use octal notationtcp_keepalives_idle = 60                # TCP_KEEPIDLE, in seconds;tcp_keepalives_interval = 10            # TCP_KEEPINTVL, in seconds;tcp_keepalives_count = 10               # TCP_KEEPCNT;shared_buffers = 2048MB                 # min 128kBmaintenance_work_mem = 512MB            # min 1MBshared_preload_libraries = 'pg_stat_statements'         # (change requires restart)vacuum_cost_delay = 10                  # 0-100 millisecondsvacuum_cost_limit = 10000               # 1-10000 creditsbgwriter_delay = 10ms                   # 10-10000ms between roundswal_level = hot_standby     # minimal, archive, or hot_standbysynchronous_commit = off                # synchronization level;wal_buffers = 16384kB                   # min 32kB, -1 sets based on shared_bufferswal_writer_delay = 10ms         # 1-10000 millisecondscheckpoint_segments = 128               # in logfile segments, min 1, 16MB eacharchive_mode = on               # allows archiving to be donearchive_command = '/bin/date'           # command to use to archive a logfile segmentmax_wal_senders = 32            # max number of walsender processeswal_keep_segments = 256         # in logfile segments, 16MB each; 0 disableshot_standby = on                        # "on" allows queries during recoverymax_standby_archive_delay = 300s        # max delay before canceling queriesmax_standby_streaming_delay = 300s      # max delay before canceling querieswal_receiver_status_interval = 1s       # send replies at least this oftenhot_standby_feedback = on               # send info from standby to preventeffective_cache_size = 8192MBlog_destination = 'csvlog'              # Valid values are combinations oflogging_collector = on          # Enable capturing of stderr and csvloglog_directory = 'pg_log'                # directory where log files are written,log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,log_file_mode = 0600                    # creation mode for log files,log_truncate_on_rotation = on           # If on, an existing log file with thelog_rotation_age = 1d                   # Automatic rotation of logfiles willlog_rotation_size = 10MB                # Automatic rotation of logfiles willlog_min_duration_statement = 1s # -1 is disabled, 0 logs all statementslog_checkpoints = onlog_connections = onlog_disconnections = onlog_error_verbosity = verbose           # terse, default, or verbose messageslog_statement = 'ddl'                   # none, ddl, mod, alllog_timezone = 'PRC'log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions andautovacuum_vacuum_threshold = 50        # min number of row updates beforeautovacuum_analyze_threshold = 50       # min number of row updates beforeautovacuum_vacuum_scale_factor = 0.2    # fraction of table size before vacuumautovacuum_analyze_scale_factor = 0.1   # fraction of table size before analyzeautovacuum_vacuum_cost_delay = 10ms     # default vacuum cost delay fordatestyle = 'iso, mdy'timezone = 'PRC'lc_messages = 'C'                       # locale for system error messagelc_monetary = 'C'                       # locale for monetary formattinglc_numeric = 'C'                        # locale for number formattinglc_time = 'C'                           # locale for time formattingdefault_text_search_config = 'pg_catalog.english'pg_stat_statements.max=1000pg_stat_statements.track=allpg_stat_statements.save=on
3. 编译安装zabbix
查看详细的编译参数, 只有编译安装proxy和server时, 需要选择数据库类型.
[root@150 zabbix-2.2.6]# ./configure --help
选择要安装的组件, (例如server, proxy, agent全部安装)编译安装 : 
[root@150 zabbix-2.2.6]# ./configure --prefix=/opt/zabbix2.2.6 --enable-server --enable-proxy --enable-agent --enable-java --enable-ipv6 --with-postgresql=/opt/pgsql/bin/pg_config --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl --with-iconv
cnofigure时, 可能会因为缺少lib库报错, 
例如
checking for SSH2 support... noconfigure: error: SSH2 library not found
解决
[root@150 zabbix-2.2.6]# yum install -y libssh2-devel
例如
checking for OPENIPMI support... noconfigure: error: Invalid OPENIPMI directory - unable to find ipmiif.h
解决
[root@150 zabbix-2.2.6]# yum install -y OpenIPMI-devel# make && make install[root@150 zabbix-2.2.6]# ln -s /opt/zabbix2.2.6 /opt/zabbix[root@150 zabbix-2.2.6]# cd /opt/zabbix[root@150 zabbix]# lltotal 20drwxr-xr-x 2 root root 4096 Aug 31 12:10 bindrwxr-xr-x 6 root root 4096 Aug 31 12:10 etcdrwxr-xr-x 2 root root 4096 Aug 31 12:10 libdrwxr-xr-x 3 root root 4096 Aug 31 12:10 sbindrwxr-xr-x 4 root root 4096 Aug 31 12:10 share
配置/etc/profile
vi /etc/profileexport PATH=/opt/zabbix/bin:/opt/zabbix/sbin:$PATHexport MANPATH=/opt/zabbix/share/man:$MANPATHexport LD_LIBRARY_PATH=/opt/zabbix/lib:$LD_LIBRARY_PATH
其他,
1. 如果你要分发你编译好的binary, 那么可以使用静态链接库把依赖的动态库编辑进来, 那么就可以直接分发给其他OS使用了.
选项  --enable-static .
2. 如果添加了--enable-proxy, 那么会生成get和sender两条命令. 如下, 用于接收agent发生过来的信息, 同时发送给server.
[root@150 zabbix]# ll bin/total 560-rwxr-xr-x 1 root root 256830 Aug 31 12:10 zabbix_get-rwxr-xr-x 1 root root 314325 Aug 31 12:10 zabbix_sender
4. 安装nginx, php, php-fpm
参考

配置并启动php-fpm
# vi /etc/profileexport PATH=/opt/php5.5.14/bin:/opt/php5.5.14/sbin:$PATHexport MANPATH=/opt/php5.5.14/php/man:$MANPATH[root@150 ~]# php --iniConfiguration File (php.ini) Path: /opt/php5.5.14/libLoaded Configuration File:         (none)Scan for additional .ini files in: (none)Additional .ini files parsed:      (none)# . /etc/profile注意拷贝到对应的配置目录# cp php-5.5.14/php.ini-production /opt/php5.5.14/lib/php.ini# cp /opt/php5.5.14/etc/php-fpm.conf.default /opt/php5.5.14/etc/php-fpm.conf[root@150 zabbix]# which php-fpm/opt/php5.5.14/sbin/php-fpm[root@150 zabbix]# php-fpm -R -c /opt/php5.5.14/etc[root@150 zabbix]# netstat -anp|grep 9000tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      26627/php-fpm
配置并启动nginx
[root@150 conf]# pwd/opt/nginx1.6.0/conf[root@150 conf]# lltotal 60-rw-r--r-- 1 root root 1034 Aug 31 15:08 fastcgi.conf-rw-r--r-- 1 root root 1034 Aug 31 15:08 fastcgi.conf.default-rw-r--r-- 1 root root  964 Aug 31 15:08 fastcgi_params-rw-r--r-- 1 root root  964 Aug 31 15:08 fastcgi_params.default-rw-r--r-- 1 root root 2837 Aug 31 15:08 koi-utf-rw-r--r-- 1 root root 2223 Aug 31 15:08 koi-win-rw-r--r-- 1 root root 3957 Aug 31 15:08 mime.types-rw-r--r-- 1 root root 3957 Aug 31 15:08 mime.types.default-rw-r--r-- 1 root root 2639 Aug 31 15:12 nginx.conf-rw-r--r-- 1 root root 2656 Aug 31 15:08 nginx.conf.default-rw-r--r-- 1 root root  596 Aug 31 15:08 scgi_params-rw-r--r-- 1 root root  596 Aug 31 15:08 scgi_params.default-rw-r--r-- 1 root root  623 Aug 31 15:08 uwsgi_params-rw-r--r-- 1 root root  623 Aug 31 15:08 uwsgi_params.default-rw-r--r-- 1 root root 3610 Aug 31 15:08 win-utf[root@150 conf]# pwd/opt/nginx1.6.0/conf[root@150 conf]# cat nginx.confuser  nobody;worker_processes  2;#error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '    #                  '$status $body_bytes_sent "$http_referer" '    #                  '"$http_user_agent" "$http_x_forwarded_for"';    #access_log  logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    server {        listen       8080;        server_name  digoal;        root /opt/www/zabbix;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            index  index.html index.htm index.php;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        location ~ \.php$ {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }        # deny access to .htaccess files, if Apache's document root        # concurs with nginx's one        #        #location ~ /\.ht {        #    deny  all;        #}    }    # another virtual host using mix of IP-, name-, and port-based configuration    #    #server {    #    listen       8000;    #    listen       somename:8080;    #    server_name  somename  alias  another.alias;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}    # HTTPS server    #    #server {    #    listen       443 ssl;    #    server_name  localhost;    #    ssl_certificate      cert.pem;    #    ssl_certificate_key  cert.key;    #    ssl_session_cache    shared:SSL:1m;    #    ssl_session_timeout  5m;    #    ssl_ciphers  HIGH:!aNULL:!MD5;    #    ssl_prefer_server_ciphers  on;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}}启动[root@150 conf]# /opt/nginx1.6.0/sbin/nginx -c /opt/nginx1.6.0/conf/nginx.conf
5. 配置WEB
[root@150 php]# pwd/opt/soft_bak/zabbix-2.2.6/frontends/php将php目录中的所有文件拷贝到/opt/www/zabbix[root@150 frontends]# mkdir -p /opt/www/zabbix[root@150 php]# cp -a . /opt/www/zabbix/
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
搞定所有的检查未通过问题.
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
有一些默认配置要修改.
# vi /opt/php5.5.14/lib/php.inipost_max_size = 16Mdate.timezone = Asia/Shanghaimax_execution_time = 300max_input_time = 300[root@150 etc]# ps -ewf|grep phproot     14100     1  0 09:25 ?        00:00:00 php-fpm: master process (/opt/php5.5.14/etc/php-fpm.conf)nobody   14101 14100  0 09:25 ?        00:00:00 php-fpm: pool wwwnobody   14102 14100  0 09:25 ?        00:00:00 php-fpm: pool wwwroot     14604   504  0 09:32 pts/0    00:00:00 grep php[root@150 etc]# kill -9 14100[root@150 etc]# kill -9 14101[root@150 etc]# kill -9 14102[root@150 etc]# php-fpm -R
同时, 如果要使用新版本的lib, 需要重新编译.
# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.bz2# tar -jxvf freetype-2.5.3.tar.bz2# cd freetype-2.5.3# ./configure --prefix=/opt/freetype2.5.3# make && make install# ./configure --prefix=/opt/php5.5.14 --with-pcre-regex=/usr/lib64 --enable-fpm --enable-opcache --with-pdo-pgsql=/opt/pgsql/bin --with-pgsql=/opt/pgsql/bin --enable-bcmath --enable-mbstring --enable-sockets --with-gd --with-gettext --with-libdir=lib64 --with-jpeg-dir --with-png-dir --with-freetype-dir=/opt/freetype2.5.3# make && make install注意php 5.5.14的gd库是随php源码包绑定的, 所以就是2.1的版本.# 重启php-fpm# php-fpm -R -c /usr/local/etc
6. 创建数据库
[root@150 etc]# su - postgrespostgres@150-> psqlpsql (9.3.5)Type "help" for help.postgres=# create role zabbix nosuperuser login encrypted password 'digoal';CREATE ROLEpostgres=# create database zabbix with template template0 encoding 'UTF8' ;CREATE DATABASEpostgres=# grant all on database zabbix to zabbix;GRANT
7. 创建schema
shell> psql -U 
psql> create database zabbix; psql> \q shell> cd database/postgresqlshell> psql -U
zabbix < schema.sql# stop here if you are creating database for Zabbix proxy , 如果是代理的话, 只需要创建schema.shell> psql -U
zabbix < images.sqlshell> psql -U
zabbix < data.sql[root@150 postgresql]# pwd/opt/soft_bak/zabbix-2.2.6/database/postgresql[root@150 postgresql]# lltotal 2896-rw-rw-r-- 1 1000 1000 873252 Aug 27 21:08 data.sql-rw-rw-r-- 1 1000 1000 1979089 Aug 27 21:07 images.sql-rw-rw-r-- 1 1000 1000 102928 Aug 27 21:08 schema.sql[root@150 postgresql]# su - postgrespostgres@150-> cd /opt/soft_bak/zabbix-2.2.6/database/postgresql/postgres@150-> psql -h 127.0.0.1 -U zabbix zabbix -f ./schema.sqlpostgres@150-> psql -h 127.0.0.1 -U zabbix zabbix -f ./images.sqlpostgres@150-> psql -h 127.0.0.1 -U zabbix zabbix -f ./data.sql
确保没有任何报错, 注意我们这里使用了public schema, 因为不了解zabbix是否写了schema name, 所以就用public吧.

8. 继续web配置
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research

Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
这里需要配置zabbix server的主机名IP, 以及zabbix server的监听端口, 后面还可以通过配置文件来修改.
 
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
 
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
这里需要
下载配置文件到/opt/www/zabbix/conf
配置文件里可以修改zabbix server的连接IP, 端口.
[root@150 conf]# cat zabbix.conf.php
 
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
 
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research
用户密码存在数据库里面, 密码已经加密了.
用户Admin默认密码zabbix
zabbix=> select * from users;-[ RECORD 1 ]--+---------------------------------userid         | 1alias          | Adminname           | Zabbixsurname        | Administratorpasswd         | 5fce1b3e34b520afeffb37ce08c7cd66url            | autologin      | 1autologout     | 0lang           | en_GBrefresh        | 30type           | 3theme          | defaultattempt_failed | 0attempt_ip     | attempt_clock  | 0rows_per_page  | 50-[ RECORD 2 ]--+---------------------------------userid         | 2alias          | guestname           | surname        | passwd         | d41d8cd98f00b204e9800998ecf8427eurl            | autologin      | 0autologout     | 900lang           | en_GBrefresh        | 30type           | 1theme          | defaultattempt_failed | 0attempt_ip     | attempt_clock  | 0rows_per_page  | 50
[问题]
1. gd jpeg, freetype的支持问题, 
在zabbix WEB配置时一直显示不通过, 
Install zabbix 2.2 + PostgreSQL + nginx + php on CentOS 6.x x64 - 德哥@Digoal - PostgreSQL research

检测代码如下 : 
/opt/www/zabbix/include/classes/class.frontendsetup.php
/**         * Checks for PHP GD JPEG support.         *         * @return array         */        public function checkPhpGdJpeg() {                if (is_callable('gd_info')) {                        $gdInfo = gd_info();                        // check for PHP prior 5.3.0, it returns 'JPG Support' key.                        $current = isset($gdInfo['JPG Support']) ? $gdInfo['JPG Support'] : $gdInfo['JPEG Support'];                }                else {                        $current = false;                }                return array(                        'name' => _('PHP gd JPEG support'),                        'current' => $current ? _('on') : _('off'),                        'required' => null,                        'result' => $current ? self::CHECK_OK : self::CHECK_FATAL,                        'error' => _('PHP gd JPEG image support missing.')                );        }        /**         * Checks for PHP GD FreeType support.         *         * @return array         */        public function checkPhpGdFreeType() {                if (is_callable('gd_info')) {                        $gdInfo = gd_info();                        $current = $gdInfo['FreeType Support'];                }                else {                        $current = false;                }                return array(                        'name' => _('PHP gd FreeType support'),                        'current' => $current ? _('on') : _('off'),                        'required' => null,                        'result' => $current ? self::CHECK_OK : self::CHECK_FATAL,                        'error' => _('PHP gd FreeType support missing.')                );        }
配置代码如下 : 
php-5.5.14/configure
if test "$PHP_JPEG_DIR" != "no"; then    for i in $PHP_JPEG_DIR /usr/local /usr; do      test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break    done    if test -z "$GD_JPEG_DIR"; then      as_fn_error $? "jpeglib.h not found." "$LINENO" 5    fi....  if test "$PHP_FREETYPE_DIR" != "no"; then    for i in $PHP_FREETYPE_DIR /usr/local /usr; do      if test -f "$i/bin/freetype-config"; then        FREETYPE2_DIR=$i        FREETYPE2_CONFIG="$i/bin/freetype-config"        break      fi    done    if test -z "$FREETYPE2_DIR"; then      as_fn_error $? "freetype-config not found." "$LINENO" 5    fi
解决办法, 把源码包删掉重新编译.
可能是原来的configure遗留的问题. 一直在此基础上做编译安装导致的.

[参考]
1. 
2. 

转载地址:http://qhbxa.baihongyu.com/

你可能感兴趣的文章
chpasswd
查看>>
mysqldump --single-transaction 和--lock-tables参数详解
查看>>
android 数据库_sql语句总结
查看>>
python购物车
查看>>
解决python2和python3的pip冲突
查看>>
面试/编程
查看>>
linux每日命令(16):head命令
查看>>
公司内部分享【富有成效的每日站会】总结
查看>>
打造一个上传图片到图床利器的插件(Mac版 开源)
查看>>
iOS横竖屏
查看>>
thinkphp判断更新是否成功
查看>>
Do While ... Loop 与 Do Until ... Loop 的区别
查看>>
【Linux】查询某个字符串出现次数
查看>>
高效使用jquery之一:请使用'On'函数
查看>>
冲刺第一周第三天
查看>>
ERP环境检测工具设计与实现 Environment Detection
查看>>
不要在构造中做太多事情,不然有时候会出现有意思的代码~
查看>>
IIS 发布网站遇到的问题
查看>>
NuGet学习笔记(2)——使用图形化界面打包自己的类库
查看>>
xcode中没有autoSizing的设置
查看>>